Snaapi is configured entirely through environment variables. You can set them in
a .env file, in your Docker Compose environment: block, or as system
environment variables.
Required vs Optional: The following variables must be set for Snaapi to start:
DATABASE_URL: PostgreSQL connection stringBETTER_AUTH_SECRET: secret key for signing tokensBETTER_AUTH_URL: the public base URL of your Snaapi instanceSNAAPI_SESSION_SECRET: session encryption secretAll other variables below are optional and have sensible defaults.
Connection settings for PostgreSQL:
| Variable | Description | Default |
|---|---|---|
DATABASE_URL |
PostgreSQL connection string | none |
DATABASE_URL="postgres://user:password@localhost:5432/snaapi"General application configuration:
| Variable | Description | Default |
|---|---|---|
APP_ENV |
Environment mode (development, production) |
development |
SNAAPI_LOG_LEVEL |
Log verbosity (debug, info, warn, error) |
debug |
SNAAPI_AUTO_MIGRATE |
Run database migrations on startup | true |
SNAAPI_ENABLE_WORKER |
Enable background job worker | true |
SNAAPI_INSTALL_TOKEN |
Token for initial setup/install | none |
SNAAPI_DOCS_PUBLIC |
Make documentation pages publicly accessible | true |
SNAAPI_OPENAPI_PUBLIC |
Make OpenAPI spec publicly accessible | true |
Core authentication settings powered by Better Auth:
| Variable | Description | Default |
|---|---|---|
BETTER_AUTH_SECRET |
Secret key for signing tokens | none |
BETTER_AUTH_URL |
Base URL of your application | none |
SNAAPI_SESSION_SECRET |
Session encryption secret | none |
ENABLE_EMAIL_PASSWORD_LOGIN |
Enable email/password authentication | true |
REQUIRE_EMAIL_VERIFICATION |
Require email verification before login | false |
SNAAPI_DEFAULT_ROLE |
Default role assigned to new users on signup | user |
BETTER_AUTH_SECRET="your-secret-key"
BETTER_AUTH_URL="http://localhost:5173"
ENABLE_EMAIL_PASSWORD_LOGIN=trueEnable social login by setting both the client ID and client secret for each provider:
| Variable | Description |
|---|---|
AUTH_GOOGLE_CLIENT_ID |
Google OAuth client ID |
AUTH_GOOGLE_CLIENT_SECRET |
Google OAuth secret |
AUTH_GITHUB_CLIENT_ID |
GitHub OAuth client ID |
AUTH_GITHUB_CLIENT_SECRET |
GitHub OAuth secret |
AUTH_GOOGLE_CLIENT_ID="your-google-client-id"
AUTH_GOOGLE_CLIENT_SECRET="your-google-client-secret"
AUTH_GITHUB_CLIENT_ID="your-github-client-id"
AUTH_GITHUB_CLIENT_SECRET="your-github-client-secret"Set API keys to enable the AI Assistant feature (at least one required):
| Variable | Description |
|---|---|
ANTHROPIC_API_KEY |
Anthropic (Claude) API key |
OPENAI_API_KEY |
OpenAI API key |
GOOGLE_GENERATIVE_AI_API_KEY |
Google Gemini API key |
Observability and tracing configuration:
| Variable | Description | Default |
|---|---|---|
OTEL_DENO |
Enable OpenTelemetry tracing and metrics collection (true or false) |
true |
OTEL_SERVICE_NAME |
Service name reported to your OTEL collector (useful for multi-service setups) | none |
OTEL_DENO=true
OTEL_SERVICE_NAME="snaapi-production"