SDK installation
Add Vexil to your app in two steps — install the package and initialize the client.
Install the package
The SDK works in Node.js, Bun, Deno, and modern browsers. It has no required dependencies.
Initialize the client
Create one ff instance and reuse it across your application — it's safe to share.
Getting your API key
In the dashboard, go to Settings → API Keys, click Create key, give it a name (e.g. "Production"), and copy the value. Store it as an environment variable — never hardcode it.
API keys are only shown once at creation time. If you lose one, revoke it and create a new one.
Constructor options
| Option | Required | Default | Description |
|---|---|---|---|
| apiKey | Yes | — | Your per-org API key from Settings → API Keys. |
| baseUrl | Yes | — | The URL of your Vexil API server. |
| timeout | No | 3000 ms | How long to wait for the API before returning the fallback value. |
| defaultEnvironment | No | "production" | Environment slug used when none is passed per-call. |