Environments
An Environment is a deployment stage within a Project. Each environment is fully isolated — its own sources, lenses, API keys, and ingest jobs. This lets you develop and test schema changes without touching production data or indexes.
Default Setup
When you create a project, a development environment is created automatically.
A typical setup adds staging and production as you ship:
Create an Environment
Console: Project page → Environments → New environment.
CLI:
Each environment gets its own sk_ / pk_ / ik_ API keys created automatically.
Switch Environments
CLI — update your context:
Or run semilayer init again to select a different environment interactively.
Console: Use the environment selector in the top navigation to switch between environments in the same project.
API Keys Per Environment
Keys are scoped to the environment in which they were created. A sk_live_ key for
your production environment cannot access staging.
Promoting Config Between Environments
To promote a lens config from staging to production:
Console: Open the Multi-environment comparison view from the environment selector → select the source environment → click Promote.
CLI — export then push:
Or copy manually: the lens config is just the object in sl.config.ts. Promote by
editing the file and pushing to the target environment.
Environment Variables
In your application, inject the right key and base URL per environment:
Isolating Ingest
Each environment runs its own ingest independently. You can have production running
continuous incremental syncs while staging is paused, or run a --rebuild on
staging without affecting production.
Delete an Environment
Console: Settings → Environments → Delete (admin role required).
Deleting an environment permanently removes all its lenses, indexed data, sources, and API keys. This cannot be undone.