Skip to main content

System environment variables

Sean DubbFounder, Easel.sh

Every deployment now gets system environment variables that describe where it runs. Preview deployments know their own URL, so auth callbacks, absolute links, and OAuth redirects point at the right origin without per-branch configuration.

Variables Easel sets

Easel sets these for you:

  • EASEL_ENV: production or preview, at build and runtime
  • EASEL_URL: the deployment’s unique URL hostname, at build and runtime
  • EASEL_BRANCH_URL: the branch URL hostname, when the deployment has a branch
  • EASEL_PROJECT_PRODUCTION_URL: the shortest live custom domain, or the generated production hostname
  • EASEL_REGION: the function region, at runtime
  • EASEL_DEPLOYMENT_ID: the deployment ID, at runtime

URL values are hostnames without https://. A variable you define with the same name takes precedence.

Vercel names and public prefixes

Each variable is also set under its VERCEL_ name, such as VERCEL_URL and VERCEL_PROJECT_PRODUCTION_URL, so libraries and code written for Vercel work unchanged.

Easel also copies them under your framework’s public prefix, such as NEXT_PUBLIC_VERCEL_URL or VITE_EASEL_URL, so client code can read them, matching Vercel’s behavior. Public values are embedded at build time.

Use it for auth callbacks

Build your base URL from EASEL_URL or VERCEL_URL in previews and from EASEL_PROJECT_PRODUCTION_URL in production, adding https:// yourself. Each preview then sends users back to its own hostname after sign-in.

See System variables for the full table.

Talk to us

Book a short call and we'll walk through your current infrastructure bill together.

Talk to us