apiker

API for Cloudflare Workers & Wrangler

Usage no npm install needed!

<script type="module">
  import apiker from 'https://cdn.skypack.dev/apiker';
</script>

README

Create Serverless APIs using Cloudflare Workers, Durable Objects & Wrangler

npm version latest commit join our chat

📦 Installation & Usage

With Apiker, you can create an API in only 3 lines of code

import { apiker, res } from "apiker";
const routes = { "/users/:id/hello": () => res("Hello World!") };

apiker.init({ routes, exports, objects: ["Common"] });

➡️ GET /users/my-user/hello

{ "message": "Hello World!" }

Check out the Getting Started page to begin.

Note: To run Apiker, you need a Cloudflare account with Durable Objects access.

⭐ Features

  • Easy routing & state management
  • Basic JWT-based Auth (register, login, refresh token, delete user)
  • Automatically updates Durable Object migrations, classes and bindings so you don't have to.
  • Get and set object state easily. e.g: await state().get(paramInCommonObj); or await state("MyObjectName").put({ myParam });

New:

  • Rate Limiting
  • Firewall support (IP bans with Cloudflare Firewall)
  • Ability to send emails (with Sendinblue)
  • Simple Admin panel
  • User IP geolocation
  • Logging handlers

📕 Why Apiker?

Apiker was developed to cut down on API building time and complexity. API creation can take a considerable time, and it often represents the main painpoint in getting your MVP to production.

The goal of Apiker is to let you jump straight to route creation, where you can leverage persistent key-value state quickly. Apiker also provides useful handlers should you need them, such as JWT Auth, Hashing, Rate Limiting, Email, among others.

✅ Contributing

PRs and issues are welcome. Feel free to submit any issues you have at: https://github.com/hodgef/Apiker/issues

Questions? Join the chat