Skip to content

🔐 Environment Variables (.env) ​

🏠 Documentation Hub > Configuration > Environment Variables

Reverb uses environment variables defined in a .env file at the root of the project to securely load Discord credentials and database connection options.

All static bot settings (such as the default prefix, developer IDs, and audio streaming nodes) are configured in config.reverb.js.


1. Complete Variable Reference ​

VariableRequiredDefaultDescription
CLIENT_IDYesNoneThe Discord Application (Client) ID from the Developer Portal.
CLIENT_SECRETCond.NoneThe Discord OAuth2 Client Secret (used for the upcoming web dashboard).
CLIENT_TOKENYesNoneThe Discord Bot Token generated in the Developer Portal.
DATABASE_PROVIDERNosqliteDatabase engine selection: sqlite, mongodb, postgres, mysql, or pglite.
MONGO_URICond.mongodb://127.0.0.1:27017/reverbConnection string for MongoDB (used when DATABASE_PROVIDER="mongodb").
POSTGRES_URLCond.postgres://postgres:postgres@localhost:5432/reverbConnection URL for PostgreSQL (used when DATABASE_PROVIDER="postgres").
MYSQL_URLCond.NoneConnection URL for MySQL (used when DATABASE_PROVIDER="mysql").
SQLITE_PATHNo./data/reverb.dbFile path where the local SQLite database file is stored.
PGLITE_DATA_DIRNo./data/reverb-pgdataData directory for the local PGLite embedded database.
DATABASE_URLNoNoneOptional unified connection URL; auto-detected if DATABASE_PROVIDER is not specified.
MAIN_COLORNo#FF66C4Optional brand accent hex color override for embeds and UI containers.

Where are Audio Nodes and Bot Prefix Configured?

Audio streaming nodes (NodeLink and Lavalink) and the default command prefix are configured in config.reverb.js under music.nodes and bot.prefix, keeping connection clustering and player options cleanly organized.


2. .env.example Template ​

Reverb includes a ready-to-use template in .env.example:

dotenv
CLIENT_ID=
CLIENT_SECRET=
CLIENT_TOKEN=

# Database selection: mongodb | postgres | mysql | sqlite | pglite
# If left empty, will auto-detect from MONGO_URI, DATABASE_URL, or default to sqlite
DATABASE_PROVIDER=sqlite

# Provider specific options:
MONGO_URI=mongodb://127.0.0.1:27017/reverb
# POSTGRES_URL=postgres://postgres:postgres@localhost:5432/reverb
# MYSQL_URL=mysql://root:password@localhost:3306/reverb
# SQLITE_PATH=./data/reverb.db
# PGLITE_DATA_DIR=./data/reverb-pgdata

3. Best Practices & Security ​

  1. Never commit .env to version control: The .gitignore file is pre-configured to ignore .env. Keep your bot token and database credentials private.
  2. Rotating Compromised Tokens: If your CLIENT_TOKEN is accidentally pushed or leaked, visit the Discord Developer Portal immediately and click Reset Token.
  3. Developer Permissions: To grant users permission to run developer commands or bypass DJ restrictions, configure their Discord User IDs in config.reverb.js under bot.developerIds.

⏭️ Next Step ​

Proceed to Bot Configuration (config.reverb.js) to configure audio nodes, developer IDs, UI colors, and emojis.