Skip to content

Environment Variables

Complete reference for all environment variables used by Derma Consent.

Required

VariablePackageDescription
DATABASE_URLBackendPostgreSQL connection string. Example: postgresql://derma:password@localhost:5433/dermaconsent
AUTH_SECRETBackendSecret for signing JWT tokens. Use a random 64+ character string.
FRONTEND_URLBackendPublic URL of the frontend. Used for CORS and email links. Example: http://localhost:3000
NEXT_PUBLIC_API_URLFrontendPublic URL of the backend API. Example: http://localhost:3001

Backend Server

VariableDefaultDescription
BACKEND_PORT3001Port the NestJS server listens on

Stripe (Billing)

Leave empty to disable billing features.

VariablePackageDescription
STRIPE_SECRET_KEYBackendStripe secret API key (sk_...)
STRIPE_WEBHOOK_SECRETBackendWebhook signing secret (whsec_...)
STRIPE_PLATFORM_FEE_PERCENTBackendPlatform fee for Connect payments (default: 5)
NEXT_PUBLIC_STRIPE_PUBLISHABLE_KEYFrontendStripe publishable key (pk_...)

Email (Resend)

VariablePackageDescription
RESEND_API_KEYBackendAPI key from resend.com. Required for sending consent links and team invites.

File Storage (Supabase)

VariablePackageDescription
SUPABASE_URLBackendSupabase project URL
SUPABASE_SERVICE_KEYBackendSupabase service role key (full access)
SUPABASE_ANON_KEYBackendSupabase anonymous key

OAuth Providers

Providers auto-register when their environment variables are set. All are optional — credentials login is always available.

Google

VariableDescription
GOOGLE_CLIENT_IDGoogle OAuth client ID
GOOGLE_CLIENT_SECRETGoogle OAuth client secret

Microsoft Entra (Azure AD)

VariableDescription
AZURE_AD_CLIENT_IDMicrosoft Entra application ID
AZURE_AD_CLIENT_SECRETMicrosoft Entra client secret
AZURE_AD_TENANT_IDMicrosoft Entra tenant ID

Apple

VariableDescription
APPLE_IDApple Services ID
APPLE_SECRETApple client secret

Local Development Defaults

The .env.example file provides working defaults for local development:

bash
DATABASE_URL=postgresql://derma:derma_local_pwd@localhost:5433/dermaconsent
AUTH_SECRET=dev-secret-change-in-production
FRONTEND_URL=http://localhost:3000
NEXT_PUBLIC_API_URL=http://localhost:3001
BACKEND_PORT=3001

DSGVO-konforme digitale Einwilligungen