.env files. In practice, most teams use it in one of two ways:
- The SDK reads variables directly in your app.
- The CLI manages variables and pulls them into local files when you want a classic
.envworkflow.
Quickstart
Install the CLI, add
barekey.json, create a variable, and read it with the SDK.SDK guide
Learn constructor options, auth resolution, typegen, dynamic reads, public reads, and standalone mode.
CLI guide
Learn every command, target resolution rules, output modes, and practical day-to-day workflows.
Local development
Use
barekey.json, pull values into .env.local, or point the SDK at local .env files with standalone mode.Recommended workflows
Use the SDK in application code
Use@barekey/sdk/server when your app should resolve variables directly:
- server apps
- worker runtimes
- edge functions
- scripts that already run in Node, Bun, or another
fetch-compatible runtime
Use the CLI for setup, management, and local files
Use@barekey/cli when you want to:
- log in once on a machine
- create or update variables from the terminal
- inspect stage values
- pull resolved values into
.env,.env.local, or JSON - run
typegenfor your installed SDK package
Use standalone mode for local .env compatibility
The server SDK also supports config.mode: "standalone". In that mode it reads local .env* files instead of calling the Barekey API. That gives you one SDK API for both:
- centralized Barekey-backed environments
- purely local development and testing
Core model
Variables are scoped by:- An organization is your team scope.
- A project is an app or service inside that organization.
- A stage is an environment such as
development,staging, orproduction. - A variable is a named value inside one project stage.
secretab_roll

