TypeScript Types
Complete TypeScript type reference for the WaitKit SDK. Includes WaitKitConfig, JoinOptions, JoinResult, ApiResponse, WaitKitError, and all exported interfaces for type-safe integration.
The SDK exports full TypeScript declarations. All types are available from the main entry point:
import type { WaitKitConfig, JoinOptions, JoinResult, ApiResponse } from "waitkit";WaitKitConfig
Configuration object passed to the WaitKit constructor.
interface WaitKitConfig {
apiKey: string;
projectSlug: string;
baseUrl?: string;
source?: string;
}| Field | Type | Default | Description |
|---|---|---|---|
apiKey | string | - | API key from the dashboard |
projectSlug | string | - | Slug identifying the project |
baseUrl | string | https://api.waitkit.dev | API base URL (self-hosted only) |
source | string | "landing-page" | Default source for all signups |
JoinOptions
Parameters for creating a waitlist subscriber.
interface JoinOptions {
email: string;
name?: string;
source?: string;
metadata?: Record<string, unknown>;
}| Field | Type | Required | Description |
|---|---|---|---|
email | string | yes | Subscriber email address |
name | string | no | Subscriber display name |
source | string | no | Overrides the default source for this signup |
metadata | Record<string, unknown> | no | Arbitrary JSON-serializable metadata |
JoinResult
Returned by a successful subscribers.create() call.
interface JoinResult {
message: string;
email: string;
}| Field | Type | Description |
|---|---|---|
message | string | Success confirmation message |
email | string | Subscriber email address |
ApiResponse
Discriminated union returned by the API. Used internally by the SDK.
type ApiResponse<T> = SuccessResponse<T> | ErrorResponse;SuccessResponse
interface SuccessResponse<T> {
status: "success";
message: string;
data: T;
timestamp: number;
}ErrorResponse
interface ErrorResponse {
status: "error";
message: string;
statusCode: number;
timestamp: number;
details?: unknown;
issues?: ErrorIssue[];
}ErrorIssue
A single validation error returned by the API.
interface ErrorIssue {
path: string;
message: string;
}| Field | Type | Description |
|---|---|---|
path | string | The field that failed validation |
message | string | Human-readable description of the issue |
WaitKitError
Error class thrown by SDK methods on API failure.
class WaitKitError extends Error {
name: "WaitKitError";
statusCode?: number;
issues?: Array<{ path: string; message: string }>;
}See the SDK Errors page for usage patterns.
React Hook
Integrate waitlist signups into your React app with the useWaitlist hook from waitkit/react. Reactive state for join, count, loading, and error handling in React components.
SDK Errors
Handle WaitKitError thrown by the JavaScript SDK. Learn try-catch patterns, error status codes (400, 401, 404, 409, 429), and how to parse validation issues from API responses.
