Skip to content

Environment Variables

Download your .env template from the customer portal — your LICENSE_KEY and DISCORD_GUILD_ID are already filled in. Replace every __FILL_IN__ placeholder before starting SmartCAD.

Required

dotenv
# Your purchased SmartCAD license key
LICENSE_KEY=

# The public URL of your CAD (must match your domain exactly, including https://)
BASE_URL=https://cad.yourcommunity.com

# A random secret used to sign auth sessions - generate one with:
# openssl rand -hex 32
BETTER_AUTH_SECRET=

# Your Discord application credentials
DISCORD_CLIENT_ID=
DISCORD_CLIENT_SECRET=

# The ID of your Discord server (guild)
DISCORD_GUILD_ID=

# Bot token used for Discord role lookups in Community Oversight
DISCORD_BOT_TOKEN=

# Your domain (must match BASE_URL, without https://)
CADDY_DOMAIN=cad.yourcommunity.com

Discord Role IDs (optional after first boot)

These seed the database on first startup. After that, role IDs are managed from the Community Oversight → Settings admin panel and the .env values are ignored.

TIP

If you prefer a pure UI workflow, leave these blank on first boot and configure them immediately after logging in as a Command user.

dotenv
# Role IDs - comma-separated, no spaces
# Members must have at least one of these roles to log in at all
DISCORD_REQUIRED_ROLE_IDS=

# Members with these roles get Command (oversight) access
DISCORD_COMMAND_ROLE_IDS=

# Members with these roles get Officer (CAD) access
DISCORD_OFFICER_ROLE_IDS=

# Members with these roles get Supervisor access
DISCORD_SUPERVISOR_ROLE_IDS=

Branding (optional after first boot)

These seed the database on first startup. After that, branding is managed from the Community Oversight → Settings admin panel and the .env values are ignored.

dotenv
# Name shown in the UI and emails
APP_NAME=My Community CAD

# Short tagline shown on the login page hero
TAGLINE=Protecting and serving our community.

# Direct URL to your community logo (shown on login/select pages)
LOGO_URL=https://cdn.example.com/logo.png

# Direct URL to a custom favicon
FAVICON_URL=https://cdn.example.com/favicon.ico

# Background images for the login page hero - comma-separated URLs, up to 3
# One is picked at random on each page load
HERO_BG_URLS=https://cdn.example.com/bg1.jpg,https://cdn.example.com/bg2.jpg

Without this, users cannot reset their password via email.

dotenv
# API key from resend.com (free tier available)
RESEND_API_KEY=re_xxxxxxxxxxxx

# The "from" address for password reset emails
# Must be a domain you have verified in Resend
RESET_PASSWORD_FROM=My CAD <[email protected]>

FiveM integration (optional)

dotenv
# API key used to verify FiveM player sessions
# Must match setr smart_api_key in your FiveM server.cfg
FIVEM_API_KEY=

# Default city name pre-filled on new 911 calls
DEFAULT_CITY=Los Santos

Advanced

Leave these as-is unless you know what you're doing.

dotenv
# How often (ms) to re-check Discord role membership (default: 300000 = 5 min)
DISCORD_REVALIDATE_MS=300000

# Regex that driver's license numbers must match (optional)
# Example for US format: ^[A-Z]\d{7}$
DRIVER_LICENSE_REGEX=

# Watchtower auto-update check interval in seconds (default: 86400 = once per day)
WATCHTOWER_POLL_INTERVAL=86400

SmartCAD - Built for smart FiveM communities