Get Started in 3 Steps
Monitor your first critical product moment and get instant alerts.
Step 1: Get an API Key
Sign up or self-host
You’ll need an EmitKit API key to get started. You can either: Create an API key
- Log into your dashboard
- Navigate to Settings → API Keys
- Click “Create API Key”
- 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
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:
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: '[email protected]',
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: '[email protected]',
name: 'John Doe',
plan: 'pro',
signupDate: '2025-01-15'
},
aliases: [
'[email protected]', // 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: '[email protected]', // ← 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?