Skip to main content
KommtKevinOnline requires several environment variables to function properly. These variables configure database connections, Twitch API integration, and other runtime settings.

Required variables

These environment variables must be set for the application to work:
NUXT_APP_POSTGRES_URL
string
required
PostgreSQL database connection string. This is used to connect to the database where VODs and alerts are stored.Format: postgresql://username:password@host:port/databaseExample: postgresql://user:password@localhost:5432/kommtkevinonlineSource: Configured in nuxt.config.ts:22 as runtimeConfig.app.postgresUrl and used in server/db.ts:7
TWITCH_CLIENT_ID
string
required
Your Twitch application client ID. Required for authenticating with the Twitch API to fetch stream status and VOD information.Source: Used in server/api/twitch/stream/[id].ts:14,26,37 for Twitch API authentication
TWITCH_CLIENT_SECRET
string
required
Your Twitch application client secret. Used together with the client ID to obtain OAuth tokens for Twitch API requests.Source: Used in server/api/twitch/stream/[id].ts:15 for obtaining access tokens
To get Twitch API credentials:
  1. Go to the Twitch Developer Console
  2. Register a new application
  3. Set the OAuth Redirect URL (e.g., http://localhost:3000/auth/callback for local development)
  4. Copy the Client ID and generate a Client Secret

Optional variables

PORT
number
default:"3000"
The port number on which the application will listen for incoming requests.Example: PORT=8080Source: Configured in Dockerfile:5,19 as a build argument and environment variable
AUTH_ORIGIN
string
Base URL for authentication and overlay generation services. Used when generating thumbnails with overlays.Example: AUTH_ORIGIN=https://kommtkevinonline.deSource: Used in server/api/thumbnail/generate.ts:18 for fetching overlay images

Configuration in different environments

Development

Create a .env file in the root of your project:
NUXT_APP_POSTGRES_URL=postgresql://user:password@localhost:5432/kommtkevinonline
TWITCH_CLIENT_ID=your_dev_client_id
TWITCH_CLIENT_SECRET=your_dev_client_secret
PORT=3000

Docker

Pass environment variables using the -e flag or an env file:
docker run -p 3000:3000 \
  -e NUXT_APP_POSTGRES_URL="postgresql://user:password@host:5432/database" \
  -e TWITCH_CLIENT_ID="your_client_id" \
  -e TWITCH_CLIENT_SECRET="your_client_secret" \
  kommtkevinonline
Or use an env file:
docker run --env-file .env.production kommtkevinonline

Production

For production deployments, ensure environment variables are securely stored and never committed to version control. Use your hosting provider’s environment variable management system.
Never commit .env files containing secrets to version control. Add .env* to your .gitignore file.

Build docs developers (and LLMs) love