Skip to main content

Get Started in 3 Steps

Monitor your first critical product moment and get instant alerts.

Step 1: Get an API Key

1

Sign up or self-host

You’ll need an EmitKit API key to get started. You can either:
2

Create an API key

  1. Log into your dashboard
  2. Navigate to Settings → API Keys
  3. Click “Create API Key”
  4. Copy your API key (it starts with emitkit_)
Keep in mind that API keys are scoped to organizations and projects.

Step 2: Install the SDK

npm install @emitkit/js

Step 3: Send Your First Event

import { EmitKit } from '@emitkit/js';

// Initialize the client
const client = new EmitKit('emitkit_xxxxxxxxxxxxxxxxxxxxx');

// Send an event
const result = await client.events.create({
  channelName: 'general',
  title: 'Hello from EmitKit!',
  description: 'My first event',
  icon: '👋'
});

console.log('Event created:', result.data.id);
Success! You’ve sent your first event. You should see it in your EmitKit dashboard immediately.

Next Steps

Now that you’ve sent your first event, explore more features:

Track Users

Identify users and track events by user ID

Add Metadata

Attach custom data to your events

Error Handling

Handle errors and rate limits properly

API Reference

Explore the full API documentation

Common Patterns

Monitor Critical Events

import { EmitKit } from '@emitkit/js';

const client = new EmitKit('your_api_key');

// Get alerted when a user signs up
await client.events.create({
  channelName: 'signups',
  title: 'New user signed up',
  userId: 'user_123',
  metadata: {
    email: 'user@example.com',
    source: 'google',
    plan: 'free'
  }
});

Send Notifications

// Send a notification
await client.events.create({
  channelName: 'alerts',
  title: 'Payment Failed',
  description: 'Credit card declined',
  icon: '⚠️',
  notify: true
});

Track Payments

await client.events.create({
  channelName: 'payments',
  title: 'Payment Received',
  description: 'User upgraded to Pro plan',
  icon: '💰',
  userId: 'user_123',
  tags: ['payment', 'upgrade'],
  metadata: {
    amount: 99.99,
    currency: 'USD',
    plan: 'pro',
    transactionId: 'txn_abc123'
  }
});

Identify Users

// Create user identity with aliases
await client.identify({
  user_id: 'user_123',
  properties: {
    email: 'john@example.com',
    name: 'John Doe',
    plan: 'pro',
    signupDate: '2025-01-15'
  },
  aliases: [
    'john@example.com',  // Email
    'johndoe',            // Username
    'ext_12345'           // External system ID
  ]
});

// Now you can reference the user by any alias
await client.events.create({
  channelName: 'activity',
  title: 'User logged in',
  userId: 'john@example.com',  // ← Alias works!
});

Environment Variables

Best Practice: Store your API key in environment variables, not in your code.
EMITKIT_API_KEY=emitkit_xxxxxxxxxxxxxxxxxxxxx

Configuration Options

const client = new EmitKit('your_api_key', {
  // Custom base URL (for self-hosted instances)
  baseUrl: 'https://api.your-domain.com',

  // Request timeout in milliseconds
  timeout: 30000,

  // Custom fetch implementation (optional)
  fetch: customFetch
});

Need Help?

Full SDK Documentation

Learn about all SDK features and capabilities

API Reference

Complete API endpoint documentation

Self-Hosting Guide

Deploy your own EmitKit instance

Community Support

Get help from the community