WaitKitWaitKit
JavaScript SDK

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;
}
FieldTypeDefaultDescription
apiKeystring-API key from the dashboard
projectSlugstring-Slug identifying the project
baseUrlstringhttps://api.waitkit.devAPI base URL (self-hosted only)
sourcestring"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>;
}
FieldTypeRequiredDescription
emailstringyesSubscriber email address
namestringnoSubscriber display name
sourcestringnoOverrides the default source for this signup
metadataRecord<string, unknown>noArbitrary JSON-serializable metadata

JoinResult

Returned by a successful subscribers.create() call.

interface JoinResult {
  message: string;
  email: string;
}
FieldTypeDescription
messagestringSuccess confirmation message
emailstringSubscriber 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;
}
FieldTypeDescription
pathstringThe field that failed validation
messagestringHuman-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.

On this page