Skip to content
Shoal
Shoal

Core concepts

Environments

Separate flag state per stage, with keys for servers and browsers.

Every project has one or more environments. A flag exists in all of them, but its on/off state, rules and rollouts are set per environment — turning new-checkout on in development leaves production untouched.

Default environments

New projects start with development and production. Add staging, preview or one per customer region from Project settings → Environments.

Keys

Each environment has two kinds of keys:

  • Server key (sk_…) — downloads the full ruleset, including targeting rules and user lists. Keep it secret.
  • Client key (ck_…) — safe to embed in browsers and mobile apps. Evaluation happens on Shoal’s edge and only the resulting values are sent back, so your rules stay private.
TypeScript
// server
createClient({ key: process.env.SHOAL_KEY });            // sk_…
// browser
createClient({ key: import.meta.env.VITE_SHOAL_CLIENT }); // ck_…

Rotating keys

Rotate a key from the dashboard or with shoal keys rotate. The old key keeps working for 24 hours so you can roll out the new one without downtime.

Copying state between environments

Promote a tested configuration from staging to production in one step:

Terminal
npx shoal flags copy new-checkout --from staging --to production

The copy shows a diff and asks for confirmation before anything changes.

Was this page helpful?

Type to search. Results come from a local index — nothing leaves your browser.

↑ ↓ to navigate↵ to openMiniSearch · local