> ## Documentation Index
> Fetch the complete documentation index at: https://docs.barekey.dev/llms.txt
> Use this file to discover all available pages before exploring further.

# Barekey

> Barekey gives you one place to manage variables, then use them from your server, React app, CLI, or local .env workflow.

Barekey is a variable platform for teams that want something better than hand-managed `.env` files. Most teams start here:

* run `barekey login`
* run `barekey init`
* create variables from the dashboard or CLI
* read them from `@barekey/sdk/server` or `@barekey/react`

This docs site is organized around the shipped workflows instead of abstract concepts first.

<CardGroup cols={2}>
  <Card title="Quickstart" icon="bolt" href="/quickstart">
    Log in, run `barekey init`, create a variable, and read it in code.
  </Card>

  <Card title="SDK guide" icon="code" href="/integrations/javascript-sdk">
    Learn server reads, React/public reads, requirements schemas, typegen, and standalone mode.
  </Card>

  <Card title="CLI guide" icon="terminal" href="/integrations/cli">
    Learn auth, init, org/project/stage commands, env workflows, and typegen.
  </Card>

  <Card title="Local development" icon="laptop" href="/integrations/local-development">
    Use `barekey.json`, pull values into `.env.local`, or point the SDK at local `.env` files with standalone mode.
  </Card>
</CardGroup>

## 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

This is the best fit when you want current values at runtime, generated types, and less config glue in app code.

### Use React for public values

Use `@barekey/sdk/public` together with `@barekey/react` when you want public variables in a React app:

* marketing copy
* public feature flags
* browser-safe structured config
* React components that should read values without a custom fetch layer

### 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 `typegen` for 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:

```text theme={null}
organization -> project -> stage -> variable
```

* 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`, or `production`.
* A **variable** is a named value inside one project stage.

Barekey currently documents these shipped variable kinds:

* `secret`
* `ab_roll`

## What to read next

<CardGroup cols={2}>
  <Card title="Quickstart" icon="play" href="/quickstart">
    Start with a complete first-time setup.
  </Card>

  <Card title="JavaScript SDK" icon="js" href="/integrations/javascript-sdk">
    Full SDK guide and configuration reference.
  </Card>

  <Card title="CLI" icon="terminal" href="/integrations/cli">
    Full CLI guide and command reference.
  </Card>

  <Card title="Error reference" icon="triangle-exclamation" href="/api-reference/errors">
    Understand SDK and API error codes.
  </Card>
</CardGroup>
