This guide shows you how to integrate SeerStack into your application. You'll learn how to authenticate, identify users, and send your first event.
1. Get your API Key
You need an API key to send data to SeerStack.
- Log in to the SeerStack Dashboard.
- Go to Settings > Developer.
- Copy your Publishable Key.
2. Install the SDK
Install the official TypeScript/JavaScript library:
npm install seerstack3. Initialize the client
import Seerstack from 'seerstack';
const client = new Seerstack({ apiKey: process.env['SEERSTACK_API_KEY'], // e.g. 'sk_live_...'});4. Send an event
Send a test event to verify your integration.
const response = await client.events.capture({ name: 'test.event', user_id: 'internal_user', data: { message: 'Hello World', browser: 'Chrome' }});
console.log(response.success); // trueCheck your Dashboard — you should see the event appear instantly.
5. Identify a user (optional)
Associate user traits to enrich your events with user context.
await client.users.identify({ user_id: 'user_123', email: 'grace@hopper.com', name: 'Grace Hopper', attributes: { plan: 'enterprise', team_size: 15 }});