Reference for every environment variable that configures your 86d store, including required database and auth settings and optional provider integrations.
Use this file to discover all available pages before exploring further.
86d reads configuration from environment variables at startup. To get started, copy .env.example to .env in the repository root and fill in the required values. Variables that are commented out in .env.example are optional. Uncomment and set only the ones you need for the integrations you want to enable.
These three variables must be set before your store will start. The application fails validation on boot if any are missing.
Variable
Description
DATABASE_URL
PostgreSQL connection string used for all runtime queries. Example: postgresql://postgres:postgres@localhost:5432/86d
DATABASE_URL_UNPOOLED
The same connection string, without connection pooling. Used for database migrations. Set to the same value as DATABASE_URL unless you are using a pooler such as PgBouncer.
BETTER_AUTH_SECRET
Secret key used to sign session tokens and auth cookies. Generate a secure value with openssl rand -base64 32 and never commit it to source control.
Change BETTER_AUTH_SECRET before going to production. Any value other than the placeholder in .env.example is fine for local development, but you must use a cryptographically random string in production.
UUID identifying this store. Populated automatically when you run 86d init. When set, the store fetches its configuration from the 86d API instead of reading templates/<template>/config.json.
86D_API_URL
Base URL for the 86d hosted API. Defaults to https://api.86d.app. Only relevant when STORE_ID is set.
86D_API_KEY
API key for the 86d hosted API. When set, enables 86d.app SSO for admin authentication. See Authentication for details.
API key for Resend. When set, the store sends transactional emails (order confirmations, password resets, and so on) using Resend. If not set, email sending is disabled.
Enable social login by setting the corresponding variables. Any provider whose credentials are absent is disabled automatically. See Authentication for setup details.
The first configured payment provider is wired to the payments module automatically. Priority order when multiple providers are configured: Stripe, PayPal, Square, Braintree.
Stripe
Variable
Description
STRIPE_SECRET_KEY
Stripe secret API key (starts with sk_).
STRIPE_WEBHOOK_SECRET
Webhook signing secret for verifying Stripe events (starts with whsec_).
NEXT_PUBLIC_STRIPE_PUBLISHABLE_KEY
Publishable key used in the browser to initialize Stripe Elements.
STRIPE_ACCOUNT_ID
Optional connected account ID for Stripe Connect.
PayPal
Variable
Description
PAYPAL_CLIENT_ID
PayPal app client ID.
PAYPAL_CLIENT_SECRET
PayPal app client secret.
PAYPAL_WEBHOOK_ID
Webhook ID from your PayPal app configuration.
PAYPAL_SANDBOX
Set to "true" to use the PayPal sandbox environment.
Square
Variable
Description
SQUARE_ACCESS_TOKEN
Square access token.
NEXT_PUBLIC_SQUARE_APPLICATION_ID
Square application ID (client-side).
NEXT_PUBLIC_SQUARE_LOCATION_ID
Square location ID (client-side).
SQUARE_WEBHOOK_SIGNATURE_KEY
Signature key for verifying Square webhook events.
SQUARE_WEBHOOK_NOTIFICATION_URL
Publicly reachable URL Square sends webhook events to.
Braintree
Variable
Description
BRAINTREE_MERCHANT_ID
Braintree merchant ID.
BRAINTREE_PUBLIC_KEY
Braintree public key.
BRAINTREE_PRIVATE_KEY
Braintree private key.
BRAINTREE_SANDBOX
Set to "true" to use the Braintree sandbox environment.