Skip to main content

Overview

The EmitKit TypeScript/JavaScript SDK provides a type-safe, developer-friendly interface for monitoring critical product moments and sending real-time alerts.

Features

Type-Safe

Full TypeScript support with auto-generated types

Zero Dependencies

No external runtime dependencies, minimal bundle size

Error Handling

Type-safe error classes with detailed information

Rate Limiting

Automatic rate limit tracking and handling

Idempotency

Built-in support for safe retries

Tree-Shakeable

Optimized bundle size with ES modules

Installation

Basic Usage

Configuration

Basic Configuration

Advanced Configuration

Methods

events.create()

Create a new event and optionally send notifications. Parameters:
  • channelName (string, required): Channel name (auto-creates if doesn’t exist)
  • title (string, required): Event title
  • description (string, optional): Event description
  • icon (string, optional): Single emoji icon
  • tags (string[], optional): Array of tags
  • metadata (object, optional): Custom JSON metadata
  • userId (string | null, optional): User identifier
  • notify (boolean, optional): Send push notification to connected devices (default: true)
  • source (string, optional): Source identifier
Options:
  • idempotencyKey (string): For safe retries
  • timeout (number): Request timeout override
  • headers (object): Additional headers
Returns: Promise<EmitKitResponse>

identify()

Create or update a user identity with properties and aliases. Parameters:
  • user_id (string, required): Your internal user ID
  • properties (object, optional): Custom user properties
  • aliases (string[], optional): Alternative identifiers
Returns: Promise<EmitKitResponse<IdentifyUserResponse>>

Response Types

EmitKitResponse

RateLimitInfo

Error Handling

The SDK provides type-safe error classes for different error scenarios:
See Error Handling for detailed documentation.

Rate Limit Tracking

Access rate limit information from responses:

Next Steps

Creating Events

Learn about event creation and metadata

User Identity

Identify users and manage aliases

Error Handling

Handle errors and rate limits

Advanced Features

Idempotency, retries, and more