Mellow LogoMellow

Environment Variables

Every environment variable Mellow reads.

Environment variables

Mellow loads a .env file if present, then reads the environment. A starting point is .env.example in the repository.

Required

VariableDescription
TOKENDiscord bot token.
CLIENT_IDDiscord application (client) ID. Used for the invite link.
DATABASE_URLPostgreSQL connection string, e.g. postgres://user:pass@host:5432/mellow?sslmode=require. Use sslmode=disable only for a local database.
ANTHROPIC_API_KEYAnthropic API key. Without it, AI features fall back to fixed responses.
ENCRYPTION_KEY32-byte key for per-field AES-256-GCM encryption. If unset, data is stored as plain text (development only).
VariableDefaultDescription
PRIVATE_GUILD_ID-Guild that owner-only commands are registered to.
OWNER_IDS-Comma-separated Discord user IDs allowed to run owner commands.
ENCRYPTION_SALT_LISTmellow-encryption-saltComma-separated salts. Writes use the first; reads try all. Add a new salt to the front to rotate keys.
PORT9420Port for the HTTP API.
API_TOKEN-Bearer token required by POST /v1/chat and POST /v1/feedback.
LOG_LEVELinfodebug, info, warn, or error.
LOG_CHANNEL_ID-Discord channel for internal system logs (gateway, guild join/leave, startup).
VariableDefault
WEBSITE_URLhttps://mymellow.xyz
DOCS_URLhttps://docs.mymellow.xyz
SUPPORT_URLhttps://discord.gg/cYauqJfnNK
INVITE_URL<WEBSITE_URL>/invite
SOURCE_URLhttps://github.com/CodeMeAPixel/Mellow

Dashboard and Mellow+

The

dashboard

The Mellow Dashboard

Manage your preferences, Mellow+ status, data, and servers from the web.

signs users in with Discord OAuth2. It is disabled unless DISCORD_CLIENT_SECRET is set. In the Discord developer portal, add <API_PUBLIC_URL>/v1/auth/callback as a redirect under OAuth2.

VariableDefaultDescription
DISCORD_CLIENT_SECRET-OAuth2 client secret. Enables dashboard login.
API_PUBLIC_URLhttps://api.mymellow.xyzThe public URL of this API. Used for the OAuth redirect, and cookies are marked Secure when it is https.
DASHBOARD_URL<WEBSITE_URL>/dashboardWhere users land after signing in.
ALLOWED_ORIGINS-Extra origins (comma-separated) allowed to call the API with cookies, for example http://localhost:3000 in development. WEBSITE_URL is always allowed.
COOKIE_DOMAIN-Share the session cookie between the site and API subdomains, for example .mymellow.xyz. Leave empty for local development.
COOKIE_SAMESITElaxlax, strict, or none. Use none only on a development API called from another site. It requires https and must not be used in production.
SKU_MELLOW_PLUS_ID-The Mellow+ subscription SKU ID from the developer portal. Enables Mellow+.
PLUS_STORE_URLderivedOverrides the Mellow+ purchase link shown on the dashboard.

Status posting

VariableDescription
MELLOW_STATUS_API_KEYKey sent (as apiKey in the body) when posting the 5-minute status heartbeat to the website. The website checks it against its own MELLOW_STATUS_API_KEY.
STATUS_API_URLHeartbeat endpoint. Defaults to <WEBSITE_URL>/api/status.

The website's status page reads live per-shard detail directly from the bot's GET /v1/status; point the site's MELLOW_BOT_API_URL at the bot's HTTP API base for that.

GitHub (version checks and /tools github)

VariableDescription
GITHUB_TOKENOptional token for higher GitHub API rate limits.
GITHUB_REPOowner/repo. Defaults to CodeMeAPixel/Mellow, or is derived from SOURCE_URL.

Changelog

VariableDescription
PATCHNOTES_PATHPath to PATCHNOTES.md, read by the owner-only /changelog command.

Omniplex integration

VariableDescription
OMNIPLEX_TOKENToken for the Omniplex integration. Leave empty to disable.
OMNIPLEX_BASE_URLBase URL for the Omniplex API.

Operational flags

VariableDescription
MELLOW_MIGRATE_ONLYIf set, run database migrations and exit without starting the bot.
MELLOW_FORCE_DEPLOYIf set, force a full re-registration of slash commands on startup.

Notes

  • Database migrations are embedded and run automatically at startup (before anything else).
  • Command registration happens on startup: global commands overwrite the global set, and owner-only commands are pushed to PRIVATE_GUILD_ID.

On this page