OpenSky-commerce / Documentation

Environment Variables

Create a .env file in the root of the project. The variables marked Required must be set before the app will start. All others are optional depending on which features you enable.

VariableRequiredDescription
DATABASE_URLRequiredPostgreSQL connection string.
e.g. postgresql://user:password@localhost:5432/mydb
NEXTAUTH_URLRequiredCanonical URL of your deployment. Must match the domain exactly.
e.g. https://yourstore.com
NEXTAUTH_SECRETRequiredA random secret string used to sign session tokens. Generate one with: openssl rand -base64 32
e.g. your-random-secret
FORMBOLD_FORM_IDOptionalFormbold form ID for the contact and demo request forms. Get one at formbold.com.
SENDGRID_API_KEYOptionalSendGrid API key for transactional emails (order confirmations, password resets, welcome emails).
SENDGRID_FROM_EMAILOptionalThe verified sender email address in your SendGrid account.
STRIPE_PUBLISHABLE_KEYOptionalStripe publishable key (pk_live_... or pk_test_...). Only needed if using Stripe.
STRIPE_SECRET_KEYOptionalStripe secret key. Never expose this on the client.
STRIPE_WEBHOOK_SECRETOptionalStripe webhook signing secret (whsec_...). Required to verify incoming webhook events.
DO_SPACES_ENDPOINTOptionalDigitalOcean Spaces endpoint URL.
e.g. https://sfo3.digitaloceanspaces.com
DO_SPACES_CDN_ENDPOINTOptionalCDN endpoint for serving media files.
e.g. https://your-bucket.sfo3.cdn.digitaloceanspaces.com
DO_SPACES_REGIONOptionalDigitalOcean Spaces region.
e.g. sfo3
DO_SPACES_BUCKETOptionalName of your Spaces bucket.
DO_SPACES_FOLDEROptionalRoot folder within the bucket for this app's files.
DO_SPACES_KEYOptionalSpaces access key ID. Generate under API → Spaces Keys in your DO account.
DO_SPACES_SECRETOptionalSpaces secret access key. Shown only once at creation time.
NEXT_PUBLIC_SITE_URLOptionalPublic-facing site URL, used for canonical links and sitemap generation.
e.g. https://yourstore.com

Security Notes

  • Never commit your .env file to version control. Ensure .env is in .gitignore.
  • Admin API keys (Stripe secret, SendGrid) must only be used server-side. They are never accessed from client components.
  • Rotate NEXTAUTH_SECRET immediately if it is ever exposed. Rotating it will invalidate all active sessions.