Environment Variables

Give development and production the values they need, so a localhost URL or test key never ships in a ZIP build.

Environment tab in ChromeShip Studio

Add or edit a variable

Click Add variable, or open an existing row. Choose the environment first, then set its value.

Edit variable modal showing development and production values

Environments

  • Development — used during chromeship dev and development builds.
  • Production — used for production builds and the ZIP you publish.

A variable can hold one value or two. Set only one and it applies to both environments.

Generated files

ChromeShip writes one file per environment so each value has one clear destination:

  • .env.local — values read by development builds
  • .env.production — values read by production builds

Core regenerates both files on every change, so editing them by hand has no effect — change values in the dashboard, CLI, or MCP instead. Files from the older four-file layout are deleted on the next sync.

Use in extension code

A production build never reads your development values. If a build cannot find the env file it expects, ChromeShip warns with the file name and the variables it expected rather than shipping an extension that fails at runtime.

Every value injected into the extension is readable by anyone who installs it. Provider secrets belong in a backend function, not in an env file.

import { env, requireEnv } from "@/shared/lib/env";

const apiUrl = requireEnv("API_URL");       // throws if missing
const optional = env("FEATURE_FLAG");       // "" if missing

Next

When you're ready to ship, follow the build and publish guide. For the helper that reads these values at runtime, see Environment under Shared Helpers.