Platform bindings
Every app is handed a set of managed bindings on the env object passed to your api/*.js routes. They're provisioned and wired for you — there are no keys to paste or services to stand up. Read one off env and use it.
What you get
| Binding | What it is | Availability | Docs |
|---|---|---|---|
env.DB | SQL database (SQLite) | Automatic | Database |
env.STORAGE | File storage + public file URLs | Automatic | File storage |
env.AUTH | User accounts, sessions, 2FA | Always on | Auth |
env.PAYMENTS | Stripe checkout & subscriptions | Set Stripe key | Payments |
env.AI | OpenAI, Anthropic, built-in models | Attach | AI |
env.EMAIL | Send transactional email | Attach | |
env.MAP | Maps + vector tiles from your GeoJSON | On reference | Maps |
env.GEO | Spatial queries (PostGIS) | Paid plan | Spatial queries |
env.SEARCH | Semantic search / RAG over your text | Paid plan | Semantic search |
env.MEETING | Record & transcribe Zoom/Meet/Teams calls | Paid plan | Meeting recording |
env.ROOM | Realtime channels over WebSockets (chat, presence, multiplayer) | Paid plan | Realtime |
env.ANALYTICS | Track custom analytics events from your code | On reference | Analytics |
env.CACHE | Key-value cache | Attach | — |
Automatic bindings are attached to every app. Always on means it's built into the runtime. Attach means it's optional — your assistant adds it with manage_resource (action: attach) when you ask for it. On reference means it wires itself up automatically as soon as your code uses it (no attach step). Paid plan means it's available once the app's org is on a paid plan. Binding names are fixed; you get one of each per app.
Using a binding
Bindings live on the env argument of your route handler:
// api/signup.js
export default {
async fetch(request, env, ctx) {
const { email, password } = await request.json();
const result = await env.AUTH.signUp({ email, password });
if (!result.ok) return Response.json({ error: result.error }, { status: 400 });
// env.AUTH returns a Response with the session cookie already set
return result.response;
},
};Alongside the bindings above you also get env.APP_ID, env.ENVIRONMENT ("production" or a preview / branch name), and any environment variables you've set on the app.
Provisioning
A database and storage come attached by default. The full set of attachable resources, and how to manage them over MCP (manage_resource, action: attach/detach/list), is covered in Build & deploy an app. Secrets and config values are managed with manage_app_env (action: set/list/delete) and injected at deploy.