Skip to content

Configuration

Accounts, environment values and optional providers.

Two independent kinds of commerce

Founding 50 buys a source license. The reference app’s Stripe checkout sells recurring workspace subscriptions to your application’s users. These use separate products and fulfillment. A Founding 50 payment must never set a Signal workspace to Pro or grant credits.

Required configuration

SettingLocal developmentHosted production
DATABASE_URLYour empty local PostgreSQL databaseYour Neon pooled PostgreSQL URL; TLS certificate verification
BETTER_AUTH_SECRETGenerate at least 32 random charactersSeparate stable secret per environment
BETTER_AUTH_URLExact http://localhost:3000 originExact HTTPS app origin, no path or query
NEXT_PUBLIC_APP_NAMEYour product nameYour product name; rebuild after changing
FOUNDRYLAYER_SITE_MODEapplication for your productapplication sends / to /app; rebuild after changing
EMAIL_DELIVERY_MODEcaptureresend
EMAIL_FROMValid sender label/addressYour verified Resend sender
EMAIL_ENCRYPTION_KEYGenerate 32 bytes as 64 hex charactersStable key for the encrypted outbox
RESEND_API_KEYUnused in capture modeYour server-only key
OPENROUTER_API_KEYNeeded for real AIYour funded server-only key
AI_DEFAULT_MODELopenai/gpt-6-lunaOne of the server allowlisted models
CRON_SECRETOptional while testing manuallyGenerate 32–256 bytes for recovery calls

Root commands load .env before Turbo. Existing shell variables win over .env, so check which environment you are actually using. Direct apps/web commands need process variables or apps/web/.env.local instead.

FOUNDRYLAYER_CONTACT_EMAIL belongs to the optional FoundryLayer storefront. It only configures the email interest link and never enables payment. The official storefront uses drewsepeczi@gmail.com; purchasers using application mode should replace the public storefront/docs with their own content before launch.

AI models and budgets

The server registry currently allows openai/gpt-6-luna, openai/gpt-4o-mini, and openai/gpt-4.1-mini. Availability and provider pricing can change. User input does not select arbitrary models. Start with General and a direct prompt; Signal’s specialist graph needs larger application credit reservations.

Provider funds and application credits are independent. Free has zero included monthly credits. Use credits:grant for a verified development account, or your own Stripe subscription allowance. Do not remove reservation or ledger checks to make a demo run.

Platform administration

For organization credit adjustments and operational inspection, grant a verified account persisted admin access using the existing operator command. Obtain its UUID in your database:

Code

SELECT id, email_verified FROM "user" WHERE email = 'you@example.com';
Code

pnpm admin:operator grant YOUR_VERIFIED_USER_UUID "Initial operator assignment"

Sign in as that account and open /admin. Use a reason and an idempotency key for adjustments. Workspace ownership does not imply platform-admin authority. Revoke access with pnpm admin:operator revoke UUID "Operator access ended" when appropriate.

Optional workspace subscriptions

Create your own Stripe test-mode recurring flat-rate, quantity-one monthly and annual prices. Configure STRIPE_SECRET_KEY, STRIPE_WEBHOOK_SECRET, STRIPE_PRO_MONTHLY_PRICE_ID, and STRIPE_PRO_YEARLY_PRICE_ID with distinct price IDs. Configure the portal for supported interval changes, cancellation, and payment-method updates. Live credentials leave purchases closed by default. Set STRIPE_LIVE_CHECKOUT_ENABLED=true only after approving the exact deployed service terms/privacy, tax classification and registration scope, receipt settings and live webhook. Live Checkout requires terms consent, a billing address and automatic tax; the account must have its approved public Terms URL configured. Test-mode checkout remains available without live activation. Use a fresh billing database or reconcile every existing provider mapping before switching Stripe accounts or modes; do not delete production records to accomplish a switch.

The endpoint is /api/billing/webhook, with API version 2026-09-30.endive. Subscribe to subscription created/updated/deleted/paused/resumed; invoice paid/payment_failed/payment_action_required/finalization_failed/voided/marked_uncollectible; checkout.session completed/async_payment_succeeded/async_payment_failed.

Use Stripe CLI forwarding locally. Only verified workspace owners can start checkout. Access comes from signed webhook reconciliation of current paid subscription state, not a checkout return. Test before replacing test credentials with live credentials. Seats, coupons, and metered Stripe billing are outside the current product contract.

Until the required Stripe values validate, Usage & billing still shows credits and usage but does not offer subscription checkout/portal controls. This is application configuration availability, not a replacement for server authorization or webhook reconciliation.

Optional connected tools

Create managed OAuth auth configurations in your Composio project for Gmail, Google Calendar, and GitHub. Set COMPOSIO_API_KEY and each enabled service’s COMPOSIO_*_AUTH_CONFIG_ID. Use the normal Connect flow in Integrations and the application callback /api/integrations/callback. Test callback origin, account/workspace ownership, and disconnect/reconnect on your deployed domain.

Connections and provider account IDs are deployment-specific. They cannot be shipped in an archive. Composio owns OAuth credential storage; no purchaser receives the founder’s connected accounts. Deferred identity-verifier project configuration is unsupported. OAuth availability/consent limits remain your provider responsibility.

Set TAVILY_API_KEY for public-web search/extraction. Treat retrieved content as untrusted. Missing optional providers should leave those capabilities unavailable; do not hide missing coverage in AI answers.

Email and recovery

Auth requests commit encrypted messages to an outbox. Request follow-up delivery helps, but a scheduled drain is required during idle periods. Keep the encryption key stable until pending messages expire; key rotation requires a reviewed drain/requeue process. Capture mode fails closed in production.

Schedule the existing bounded AI, integration, and email recovery endpoints with the bearer secret. The GitHub workflow needs RECOVERY_ORIGIN and RECOVERY_CRON_SECRET in your repository. Successful configuration is not evidence of execution: inspect /admin/operations and an actual schedule-triggered job. Never automatically replay uncertain external mutations.

Explore in context