Skip to main content
Slides uses .env files to configure the server and the web frontend in development. Copy the example files before your first run:
cp apps/server/.env.example apps/server/.env
cp apps/web/.env.example apps/web/.env
Edit each file with your local values. Neither file should ever be committed to source control — both are listed in .gitignore.
Never commit .env files. They may contain secrets such as your Anthropic API key.

Server environment variables

These variables are read by apps/server at startup. They are validated against a TypeBox schema and the server will throw on import if a required variable is missing or has an invalid type.

PORT

RequiredNo
Default3000
Typenumber
The TCP port the HTTP server listens on.
PORT=4000

CORS_ORIGIN

RequiredNo
Defaulthttp://localhost:3001
Typestring
The origin(s) allowed by the CORS middleware. In development this should match the Vite dev server URL. In standalone binary mode, CORS is automatically opened to all origins and this variable has no effect.
CORS_ORIGIN=http://localhost:3001

DATA_DIR

RequiredNo
DefaultCWD/data/slideshows → bundled location
Typestring (path)
Absolute or relative path to the directory containing slideshow JSON files. If not set, the server looks for data/slideshows relative to the current working directory and then falls back to the bundled data location inside the binary.
DATA_DIR=/var/data/presentations

ANTHROPIC_API_KEY

RequiredNo (but required for AI features)
Default(none)
Typestring
API key for the Anthropic Claude API. The server starts and serves slideshows without it, but all AI assistant features will be unavailable until a valid key is provided.
ANTHROPIC_API_KEY=sk-ant-xxx
Obtain an API key from console.anthropic.com. Keep this value out of source control.

ANTHROPIC_MODEL

RequiredNo
Defaultclaude-sonnet-4-20250514
Typestring
The Anthropic model identifier used for AI assistant requests. Override this to pin to a specific model version or switch to a different Claude model.
ANTHROPIC_MODEL=claude-sonnet-4-20250514

ANTHROPIC_MAX_TOKENS

RequiredNo
Default16384
Typenumber
Maximum number of tokens the AI assistant may generate in a single response. Increase for longer outputs or decrease to reduce cost per request.
ANTHROPIC_MAX_TOKENS=16384

BETTER_AUTH_SECRET / BETTER_AUTH_URL

RequiredNo
Default(none)
Typestring
Reserved for the authentication system, which is not yet implemented. Leave these blank in current deployments.

Web environment variables

These variables are read by apps/web at build time by Vite. They must be prefixed with VITE_ to be accessible in browser code. Variables without this prefix are stripped from the bundle.

VITE_SERVER_URL

RequiredNo
Defaulthttp://localhost:3000
Typestring (URL)
The base URL of the Slides API server. The frontend ORPC client sends all requests to this origin. In development this points to the local backend. In production builds, set it to the public URL where the server is reachable.
VITE_SERVER_URL=http://localhost:3000
In standalone binary mode, VITE_SERVER_URL is set to an empty string at build time so the frontend resolves the server URL relative to the page origin. You do not need to configure this variable when using the pre-built standalone binary.

Full example files

# Server Configuration
PORT=3000
CORS_ORIGIN=http://localhost:3001

# Data Directory
# DATA_DIR=/path/to/your/slideshows

# Anthropic API
ANTHROPIC_API_KEY=sk-ant-xxx
ANTHROPIC_MODEL=claude-sonnet-4-20250514
ANTHROPIC_MAX_TOKENS=16384

# Auth (not yet implemented)
BETTER_AUTH_SECRET=
BETTER_AUTH_URL=

Build docs developers (and LLMs) love