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

# Authentication

> All FlowsBuilt SDKs authenticate with an API key from the Console.

## Getting your API key

1. Sign up at [console.flowsbuilt.com](https://console.flowsbuilt.com/signup)
2. Subscribe to the SDK you want (ChurnKit Free is automatic)
3. Go to **API Keys** → **Generate API Key**
4. Copy the key — it is shown **once** and never stored in plaintext

## Key formats

| Prefix     | Environment | Use for            |
| ---------- | ----------- | ------------------ |
| `ck_live_` | Production  | Live user data     |
| `ck_test_` | Test        | Development and CI |

<Note>
  Test keys send data to an isolated namespace — they never affect production metrics or fire production webhooks.
</Note>

## Using your key

Pass the key when constructing the SDK client:

```typescript theme={null}
import ChurnKit from '@vgpprasad91/churnkit-sdk'

const churn = new ChurnKit({ apiKey: process.env.CHURNKIT_API_KEY! })
```

<Warning>
  Never expose your API key in client-side code, browser bundles, or public repositories. Use environment variables and server-side code only.
</Warning>

## Keeping keys secure

* Store keys in environment variables (`.env`, Railway secrets, Vercel env vars, etc.)
* Rotate keys immediately if leaked — revoke the old key from the Console
* Use test keys (`ck_test_`) in CI/CD pipelines
* Create separate keys per environment (staging, production)

## Revoking a key

Go to **Console → API Keys**, click the **Revoke** button next to the key. Revocation is immediate and permanent.
