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

BindingWhat it isAvailabilityDocs
env.DBSQL database (SQLite), more by name with env.DB.database(name)AutomaticDatabase
env.STORAGEFile storage + public file URLsAutomaticFile storage
env.PAGESReal HTML pages at clean URLs, written from your data (articles, news)On referencePages from your data
env.AUTHUser accounts, sessions, 2FAAlways onAuth
env.PAYMENTSStripe checkout & subscriptionsSet Stripe keyPayments
env.AIBuilt-in models via env.AI.run("<name>", …) or by-purpose methods like env.AI.chat (no vendor key, paid as usage), plus live web via env.AI.search / env.AI.browse; OpenAI / Anthropic / Gemini / Jev are bring-your-own-keyOn referenceAI
env.EMAILSend transactional emailOn referenceEmail
env.MAPMaps + vector tiles from your GeoJSONOn referenceMaps
env.GEOSpatial queries (PostGIS)On referenceSpatial queries
env.SEARCHSemantic search / RAG over your textOn referenceSemantic search
env.MEETINGRecord & transcribe Zoom/Meet/Teams callsOn referenceMeeting recording
env.BROWSERA browser your agent drives in web apps without an API, in the cloud or on your own computer: actions, saved logins, live view for the user to log inOn referenceBrowser for agents
env.MAILBOXEmail accounts for your users: folders, threads, search, safe displayOn referenceMailboxes
env.ROOMRealtime channels over WebSockets (chat, presence, multiplayer)On referenceRealtime
env.ANALYTICSTrack custom analytics events from your codeOn referenceAnalytics
env.PUSHPush notifications to your iPhone and Android app buildsSet CR_PUSH_FCM_SERVICE_ACCOUNTMobile apps
env.CACHEKey-value cacheAttachn/a

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). Every binding is available to every workspace; what it uses is paid as usage (see Billing & usage). 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.