EdgeKit.js is a toolkit to helps you build on top of Cloudflare Development Platform with ease.
- Global environment access
- Key-Value Store
- Server-side Cache with TTL
- File Storage
- Database
- Background Jobs
- Scheduled Tasks
- Browser Rendering
- Rate Limiting
- And more things!
Create a new Edge-first app using EdgeKit.js with the following command:
npx degit edgefirst-dev/starter my-appThis will give you a new Cloudflare Worker project with EdgeKit.js already setup and React Router v7.
Install the toolkit:
bun add edgekitjsIn your Cloudflare Worker, call the bootstrap function and export it.
importschemafrom"db:schema";// Import your Drizzle schemaimport{bootstrap}from"edgekitjs/worker";exportdefaultbootstrap({orm: { schema },rateLimit: {limit: 1000,period: 60},jobs(){// Register your jobs herereturn[];},tasks(){// Schedule your tasks herereturn[];}asynconRequest(request){// Inside this function you can use all the functions provided by EdgeKit.jsreturnnewResponse("Hello, World!",{status: 200});},});declare module "edgekitjs"{exportinterfaceEnvironment{// Add your custom env variables or bindings here}// Override the default DatabaseSchema with your owntypeSchema=typeofschema;exportinterfaceDatabaseSchemaextendsSchema{}}Now you can import the functions from edgekitjs and use it in any part of your Edge-first app.