JavaScript SDK
Installation & Configuration
Install the waitkit npm package and configure the JavaScript SDK for your project. Connect to the WaitKit waitlist API with your API key and project slug.
The JavaScript SDK is the primary integration path for Node.js and browser projects. It provides a typed client and an optional React hook.
Installation
npm install waitkitThe package ships ESM, CommonJS, and TypeScript declarations. No runtime dependencies other than fetch (available in Node.js 18+, browsers, Bun, and Deno).
Configuration
Create a WaitKit instance with your API key and project slug:
import { WaitKit } from "waitkit";
const wk = new WaitKit({
apiKey: "wk_...",
projectSlug: "my-project",
});WaitKitConfig
| Param | Type | Default | Description |
|---|---|---|---|
apiKey | string | - | API key from the dashboard |
projectSlug | string | - | Slug identifying the waitlist |
baseUrl | string | https://api.waitkit.dev | API base URL (self-hosted only) |
source | string | landing-page | Default source for all signups |
See the TypeScript Types page for the full type reference, including JoinOptions, JoinResult, responses, and errors.
Resources
The WaitKit instance exposes resources that map to API endpoints:
wk.subscribers- Create subscribers and query countswk.subscribers.count()- Get subscriber count
For React projects, see the React Hook.
