Optional providers activate from environment variables and Worker bindings.
With their configuration absent, the starter uses an inactive or local adapter.
packages/env/src/server.ts declares the variables and production config audit;
BETTER_AUTH_SECRET and BETTER_AUTH_URL remain required for deployed auth.
Configure a provider
Use root .env for the web dev server, each Worker's .dev.vars for direct
Wrangler development, and the deployment shell environment for Alchemy.
alchemy.run.ts forwards declared variables and provisions the required bindings.
Restart development processes after changing configuration.
| Provider | Configuration | Without configuration |
|---|---|---|
| Cloudflare Email | CLOUDFLARE_EMAIL_FROM plus an EMAIL binding | Log dispatcher |
| Turnstile | TURNSTILE_SITE_KEY, TURNSTILE_SECRET_KEY | Sign-up has no challenge |
| GitHub sign-in | GITHUB_CLIENT_ID, GITHUB_CLIENT_SECRET | No GitHub button |
| Google sign-in | GOOGLE_CLIENT_ID, GOOGLE_CLIENT_SECRET | No Google button |
| Workers AI | WORKERS_AI_ENABLED=true plus an AI binding | Tries the next assistant provider |
| OpenAI-compatible assistant | OPENAI_API_KEY; optional OPENAI_BASE_URL, OPENAI_MODEL_ID | Mock assistant |
| Workspace export | WORKSPACE_EXPORT_BUCKET, API_PUBLIC_URL | D1-backed export actions unavailable |
| Stripe | STRIPE_SECRET_KEY, STRIPE_WEBHOOK_SECRET, STRIPE_PRICE_ID_TEAM; optional STRIPE_PRICE_ID_ENTERPRISE | Plan display and local entitlement checks remain available |
| Sentry | SENTRY_DSN | No error export to Sentry |
| PostHog | POSTHOG_KEY; optional POSTHOG_HOST | No PostHog capture |
| OTLP | OTEL_EXPORTER_OTLP_ENDPOINT | No OTLP export |
Verify activation
- Email: send an invitation on a deployed stack and inspect delivery history. Local log delivery does not prove Cloudflare sending works.
- Turnstile: load
/sign-upwith both keys set. The widget should appear; missing or invalid challenge responses must be rejected. Verification outages fail closed. - Social sign-in: the configured provider's button appears on
/sign-in. Complete a sign-in and inspect/accountfor the linked method. - Exports: request an archive as an owner, wait for its ready notification, then download it. Local D1 uses emulated R2 and Queues; the Seed adapter builds archives in memory.
- Billing: the billing page offers configured provider actions to an owner or admin. See Stripe billing for setup and recovery.
- Observability: see Sentry and PostHog for server and browser behavior.
Assistant provider order
selectAssistantLayer in packages/ai prefers enabled Workers AI, then an
OpenAI-compatible provider, then the mock. The web assistant calls the capability
through a server function; machine clients use the API Worker:
curl -s https://<api-host>/assistant/answer \
-H 'authorization: Bearer <api-token>' \
-H 'content-type: application/json' \
-d '{"workspaceSlug":"<slug>","question":"Hello"}'A configured response reports provider: "workers-ai" or
provider: "openai-compatible" and assistantConfigured: true.
Add a variable
Declare it in ServerEnv and classify it in the optional secret or plain key
list in packages/env/src/server.ts. Alchemy forwarding and Worker string-binding
types derive from those declarations. Add any required resource binding to the
infrastructure configuration.