Skip to main content

Environment Variables

Markup uses environment variables for database connectivity, authentication, and application configuration. Create a .env.local file in the project root.

Full Example


Database Variables

DATABASE_URL

PostgreSQL connection string used by Prisma. Example:

Format

Example Providers

Local PostgreSQL

Docker PostgreSQL

Supabase

Neon


WorkOS Variables

WORKOS_CLIENT_ID

Client ID for your WorkOS application. Example:

WORKOS_API_KEY

Secret API key from the WorkOS dashboard. Example:
Keep this value private.
Encryption secret used for session cookies. Generate a secure value:
Example:

NEXT_PUBLIC_WORKOS_REDIRECT_URI

Authentication callback URL.

Local Development

Production Example


Local Development Example


Docker Example


Production Recommendations

  • Never commit .env.local
  • Use strong random secrets
  • Store secrets in your hosting provider
  • Rotate API keys periodically
  • Restrict database network access
  • Enable SSL for production PostgreSQL connections

Common Issues

Prisma Cannot Connect to Database

Check:
  • PostgreSQL is running
  • Database credentials are correct
  • Port is accessible
  • SSL settings are configured correctly

WorkOS Redirect Errors

Ensure the callback URL matches exactly:
Also verify the redirect URI is configured in the WorkOS dashboard.

Ignoring Environment Files

Add environment files to .gitignore: