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

# Installation

> Install `@vibefollow/sdk` and verify your runtime is supported.

## Install

<Tabs>
  <Tab title="npm">
    ```bash theme={null}
    npm install @vibefollow/sdk
    ```
  </Tab>

  <Tab title="pnpm">
    ```bash theme={null}
    pnpm add @vibefollow/sdk
    ```
  </Tab>

  <Tab title="yarn">
    ```bash theme={null}
    yarn add @vibefollow/sdk
    ```
  </Tab>
</Tabs>

<Note>
  The SDK is published on the public npm registry. **ESM-only** — `import` works; `require` does not.
</Note>

## Runtime support

<Tabs>
  <Tab title="Node.js">
    Node **20 or later**. Earlier versions are not supported.

    ```ts theme={null}
    import { VibeFollow } from '@vibefollow/sdk';
    const vf = new VibeFollow({ apiKey: process.env.VIBEFOLLOW_API_KEY! });
    ```
  </Tab>

  <Tab title="Cloudflare Workers">
    Works with the `nodejs_compat` flag enabled in `wrangler.toml`. The flag is required for webhook verification (uses `node:crypto`); the rest of the SDK works without it.

    ```toml wrangler.toml theme={null}
    compatibility_date = "2026-05-17"
    compatibility_flags = ["nodejs_compat"]
    ```

    ```ts theme={null}
    import { VibeFollow } from '@vibefollow/sdk';

    export default {
      async fetch(req: Request, env: Env) {
        const vf = new VibeFollow({ apiKey: env.VIBEFOLLOW_API_KEY });
        await vf.users.signedUp('usr_42');
        return new Response('ok');
      },
    };
    ```
  </Tab>

  <Tab title="Vercel Edge">
    Same story as Workers — the core API works on pure Edge, but webhook verification needs the Node runtime. Use the Node runtime for any route that calls `vf.webhooks.constructEvent()`:

    ```ts theme={null}
    export const runtime = 'nodejs'; // not 'edge'
    ```
  </Tab>

  <Tab title="Deno">
    ```bash theme={null}
    deno run --allow-net --allow-env app.ts
    ```

    ```ts theme={null}
    import { VibeFollow } from 'npm:@vibefollow/sdk';
    const vf = new VibeFollow({ apiKey: Deno.env.get('VIBEFOLLOW_API_KEY')! });
    ```
  </Tab>

  <Tab title="Browser">
    <Warning>
      **Not supported.** Your API key must never leave your servers. If you want to send Vibefollow events from a SPA, build a thin server-side proxy.
    </Warning>
  </Tab>
</Tabs>

## Verify the install

```ts theme={null}
import { VibeFollow, SDK_VERSION } from '@vibefollow/sdk';

console.log('SDK version:', SDK_VERSION);
const vf = new VibeFollow({ apiKey: process.env.VIBEFOLLOW_API_KEY! });
console.log('ok');
```

<Check>
  If the import resolves and the constructor doesn't throw, you're good.
</Check>

## Bundling and tree-shaking

The SDK ships as ESM with a single entry point. Tree-shaking is supported — importing only `VibeFollow` and `WebhookSignatureError` will drop everything else from your bundle.

```ts theme={null}
import { VibeFollow, WebhookSignatureError } from '@vibefollow/sdk';
```

## Pre-releases

Beta versions are tagged on the `beta` dist-tag:

```bash theme={null}
npm install @vibefollow/sdk@beta
```

<Warning>
  Don't use pre-releases in production. They're for verifying upcoming changes against your own test suite.
</Warning>
