Skip to content
Editlet

Environment variables

Set these variables on your production host. Dev mode needs none of them. Never commit real values.

Auth handler

handleRequest from editlet/auth reads these at run time (Deploy the auth handler).

VariableRequiredValue
GITHUB_CLIENT_IDyesClient ID of your GitHub App
GITHUB_CLIENT_SECRETyesClient secret of your GitHub App, stored as a secret
ALLOWED_ORIGINSyesOrigins that may receive tokens, separated by commas or spaces, * only in the host. Empty refuses every sign-in
PUBLIC_URLunder a path or behind a proxyPublic HTTPS URL of the handler, such as https://example.com/api/editlet/oauth

Live preview (Next.js)

The editlet/next/preview route reads these when admin.preview is on (Live preview).

VariableRequiredValue
CMS_GITHUB_TOKENyesFine-grained token with read-only Contents access to the repository
CMS_PREVIEW_SECRETyesAt least 32 characters, for example from openssl rand -base64 32

Editor settings (build time)

withEditlet and the Astro integration read these at build time, also from .env files. The matching admin option wins.

VariableDefaultValue
CMS_SESSION_MINUTES60Minutes without clicks or typing before the editor signs out, a whole number from 1 to 1440 (admin.sessionMinutes)
EDITLET_PARAMeditletQuery parameter that opens the editor: letters, digits, _ and -, starting with a letter (admin.param)

The repository comes from admin.repo, else from Vercel's VERCEL_GIT_REPO_OWNER and VERCEL_GIT_REPO_SLUG, else from GITHUB_REPOSITORY in GitHub Actions. You do not set these by hand.

Public values

The build writes the repository, base branch, authUrl, session length, preview flag and a custom param to the public file /editlet/config.json. GITHUB_CLIENT_SECRET, CMS_GITHUB_TOKEN and CMS_PREVIEW_SECRET stay on the server.

For agents: this page as Markdown · llms.txt