Skip to main content

Prerequisites

Before you begin, make sure you have:
  • Node.js 20+ (download)
  • Bun (install with curl -fsSL https://bun.sh/install | bash)
  • A GitHub account (for cloning and OAuth)

Understanding bun chatjs:init

The bun chatjs:init command generates a chat.config.ts file with sensible defaults. This file controls all feature toggles, branding, and app settings.
The default configuration gives you a minimal, working setup:
SettingDefaultNotes
AuthenticationGitHub onlyGoogle and Vercel OAuth disabled
IntegrationsAll disabledNo sandbox, web search, MCP, image generation, or attachments
Anonymous users10 creditsLimited access, no tools
ModelsCurated listGPT-5 Nano/Mini, Gemini 2.5 Flash Lite, Claude Sonnet 4.5
This keeps your initial setup simple—you only need DATABASE_URL, AUTH_SECRET, AI_GATEWAY_API_KEY, and GitHub OAuth credentials to get started.Enable features incrementally by editing chat.config.ts and adding the required environment variables. See Configuration for details.

Troubleshooting

ChatJS validates env vars at build time. Check .env.local has all required variables and restart the dev server.
Verify DATABASE_URL is correct and the database is running. For local PostgreSQL, check the service is started.
Make sure the callback URL in your OAuth app matches exactly. For local dev, use http://localhost:3000/api/auth/callback/{provider}.
These environment variables enable additional capabilities:
VariableFeatureSetup Guide
REDIS_URLResumable streamsVercel KV
TAVILY_API_KEYWeb searchTavily
FIRECRAWL_API_KEYWeb searchFirecrawl
LANGFUSE_PUBLIC_KEYLLM observabilityLangfuse
LANGFUSE_SECRET_KEYLLM observabilityLangfuse
MCP_ENCRYPTION_KEYMCP connectorsopenssl rand -base64 32 (must be exactly 44 chars)
CRON_SECRETCleanup cron jobGenerate

Next Steps

You’re up and running. Here’s where to go next: