Skip to Content

Configuration

Loopstack is configured via LoopstackModule.forRoot() options and environment variables. Environment variables are read from a .env file in your project root.

All settings have sensible defaults — a fresh project works out of the box with no configuration.

LoopstackModule.forRoot() Options

LoopstackModule.forRoot({ enableAuth: false, // default: false (no authentication) database: { ... }, // PostgreSQL connection redis: { ... }, // Redis connection auth: { ... }, // JWT and hub auth settings cors: { ... }, // CORS configuration })

enableAuth

Enables authentication. When false (the default), a local development user is created automatically and no login is required.

OptionEnv varDefault
enableAuthLOOPSTACK_AUTHfalse

Set enableAuth: true or LOOPSTACK_AUTH=true to require authentication via Loopstack Hub.

database

PostgreSQL connection settings. All fields are optional — defaults connect to a local PostgreSQL instance.

OptionEnv varDefault
database.hostDATABASE_HOSTlocalhost
database.portDATABASE_PORT5432
database.usernameDATABASE_USERNAMEpostgres
database.passwordDATABASE_PASSWORDadmin
database.databaseDATABASE_NAMEpostgres
database.connection

Set database.connection to reuse an existing TypeORM connection by name. When set, Loopstack skips its own TypeOrmModule.forRoot() registration.

redis

Redis connection settings for BullMQ job queues.

OptionEnv varDefault
redis.hostREDIS_HOSTlocalhost
redis.portREDIS_PORT6379
redis.passwordREDIS_PASSWORD

auth

JWT and hub authentication settings. Only relevant when enableAuth is true.

OptionEnv varDefault
auth.jwt.secretJWT_SECRETdev-secret-change-me
auth.jwt.expiresInJWT_EXPIRES_IN1h
auth.jwt.refreshSecretJWT_REFRESH_SECRETvalue of JWT_SECRET
auth.jwt.refreshExpiresInJWT_REFRESH_EXPIRES_IN7d
auth.clientIdCLIENT_IDlocal
auth.hub.issuerHUB_ISSUERhttps://hub.loopstack.ai
auth.hub.jwksUriHUB_JWKS_URIhttps://hub.loopstack.ai/.well-known/jwks.json

cors

CORS configuration. Defaults to { origin: true, credentials: true }. Set to false to disable CORS.

Other Environment Variables

These are read directly from the environment and are not part of LoopstackModule.forRoot().

General

Env varDefaultDescription
NODE_ENVdevelopmentNode.js environment
DEFAULT_TRANSITION_TIMEOUT300000Workflow transition timeout in milliseconds (5 minutes)

LLM Providers (examples)

Set these when using the corresponding LLM provider modules.

Env varModuleDescription
ANTHROPIC_API_KEY@loopstack/claude-moduleAnthropic API key
OPENAI_API_KEY@loopstack/openai-moduleOpenAI API key

OAuth Providers (examples)

Set these when using OAuth modules for third-party integrations.

Env varModuleDescription
GITHUB_CLIENT_ID@loopstack/github-moduleGitHub OAuth app client ID
GITHUB_CLIENT_SECRET@loopstack/github-moduleGitHub OAuth app client secret
GITHUB_OAUTH_REDIRECT_URI@loopstack/github-moduleGitHub OAuth redirect URI
GOOGLE_CLIENT_ID@loopstack/google-workspace-moduleGoogle OAuth client ID
GOOGLE_CLIENT_SECRET@loopstack/google-workspace-moduleGoogle OAuth client secret
GOOGLE_OAUTH_REDIRECT_URI@loopstack/google-workspace-moduleGoogle OAuth redirect URI

Docker Compose

The default docker-compose.yml starts PostgreSQL, Redis, and Studio with settings that match the defaults above — no .env file needed for local development.

curl -fOL https://loopstack.ai/docker-compose.yml docker compose up -d

To customize, create a .env file next to your docker-compose.yml:

DATABASE_PASSWORD=my-secure-password VITE_API_URL=http://localhost:3000

The VITE_API_URL variable tells Studio where your backend is running. It defaults to http://localhost:3000.

Last updated on