Vexil/Docs/Installation
Dashboard

SDK installation

Add Vexil to your app in two steps — install the package and initialize the client.

Install the package

bash
# npm
npm install @vexilapp/sdk

# yarn
yarn add @vexilapp/sdk

# bun
bun add @vexilapp/sdk

The SDK works in Node.js, Bun, Deno, and modern browsers. It has no required dependencies.

Initialize the client

ts
import { Vexil } from '@vexilapp/sdk'

const ff = new Vexil({
  apiKey: process.env.VEXIL_API_KEY,
  baseUrl: 'https://your-api.example.com',
})

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

OptionRequiredDefaultDescription
apiKeyYesYour per-org API key from Settings → API Keys.
baseUrlYesThe URL of your Vexil API server.
timeoutNo3000 msHow long to wait for the API before returning the fallback value.
defaultEnvironmentNo"production"Environment slug used when none is passed per-call.
← PreviousMetrics & statsNext →Evaluating flags