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

# Installation

> Install the Superflag Node and server SDK

# Node and server SDK

`@superflag-sh/node` synchronizes advanced configuration with a secret server
key and evaluates it locally through `@superflag-sh/core`.

```bash theme={null}
npm install @superflag-sh/node
```

The current package requires Node 20 or newer. It also runs in Bun, Deno,
serverless, and edge runtimes that provide standard `fetch` and
`AbortController` APIs.

## Create a server key

Create an environment-scoped `sdk_` key in the dashboard or CLI, then store it
in a server-only secret:

```bash theme={null}
SUPERFLAG_API_KEY=sdk_...
```

<Warning>
  Never use `NEXT_PUBLIC_*` or `EXPO_PUBLIC_*` for a server key. Do not include it
  in a browser bundle, mobile app, response, log, or persisted cache.
</Warning>

## Create one client

```ts theme={null}
import { createSuperflag } from "@superflag-sh/node"

export const flags = createSuperflag({
  apiKey: process.env.SUPERFLAG_API_KEY!,
})
```

Create the client once at module scope so concurrent requests share one
in-memory configuration cache and coalesced refresh work.

<CardGroup cols={2}>
  <Card title="Use flags on the server" icon="code" href="/docs/node/usage">
    Add request targeting, typed values, and diagnostics.
  </Card>

  <Card title="API reference" icon="book" href="/docs/node/api-reference">
    Review methods, options, state, and failure behavior.
  </Card>
</CardGroup>
