Skip to Content
Technical docsEnvironment variables

Environment variables

VariableRequiredPurpose
NEXT_PUBLIC_AZURE_CLIENT_IDYesEntra application (client) ID
AZURE_CLIENT_SECRETYes (prod / silent refresh)Confidential client secret
NEXT_PUBLIC_APP_URL / APP_URLYesCanonical origin for links and redirects
UPSTASH_REDIS_REST_URLYesRedis REST endpoint
UPSTASH_REDIS_REST_TOKENYesRedis token (also may sign cookies)
UPLOAD_ACCESS_SECRETRecommended in prodDedicated cookie signing secret
ALLOWED_ADMIN_EMAILSRecommendedComma/newline list of admin emails
AZURE_AUTHORITYOptionalDefault https://login.microsoftonline.com/common
ONEDRIVE_REDIRECT_URIOptionalNarrow registered redirect URI
BLOB_READ_WRITE_TOKEN / BLOB_STORE_IDVercelPersist MSAL OneDrive token cache
ONEDRIVE_CACHE_PATHOptional localOverride local token cache path
AZURE_COMMUNICATION_SERVICES_CONNECTION_STRINGFor emailACS connection string
AZURE_EMAIL_SENDER_ADDRESSFor emailVerified MailFrom address

Email setup reminder

Connection string comes from the Communication Services resource → Settings → Keys.

The Email Communication Services resource has no keys; its domain must be connected under Communication Services → Email → Domains. Mismatched sender domains produce DomainNotLinked.

Redirect URIs to register in Entra

{APP_URL}/api/auth/onedrive/callback {APP_URL}/api/auth/upload-access/callback

Local development

npm install # Create .env.local with Azure, Upstash, and optional ACS variables npm run dev

Useful scripts: npm run build, npm start, npm run lint, npm run typecheck, npm run format.

Local LAN testing: next.config.ts may list allowedDevOrigins (for example a machine LAN IP) so phones can load HMR assets during next dev.

Last updated on