SDKsIngest
Node.js SDK (ingest)
Quickly integrate the Ours Privacy Node.js SDK using npm. Send test requests from the Track Events API reference.
Use this page to install the Ours Privacy Node.js SDK and send events from your server. Every request takes your Ingest API source's API key as token. Copy it from the API Keys card on the source's Settings tab.
Installation
Install the SDK via npm:
npm install @oursprivacy/server-sdkFor more details, visit the NPM Repo | Github Repo.
Usage
Create a client and track an event:
import OursPrivacy from '@oursprivacy/server-sdk';
const client = new OursPrivacy();
// Track an event
await client.track.event({
token: 'your-source-token',
event: 'Purchase',
userId: 'user123',
});
// Identify a user
await client.visitor.upsert({
token: 'your-source-token',
userId: 'user123',
userProperties: {
email: 'user@example.com',
first_name: 'John',
last_name: 'Doe',
},
});Next Steps
- Ingest API Integration: match events to visitors, backfill past events, and test with a Test Mode key.
- Track Events API reference and Identify Visitors API reference: every field the SDK accepts.
- Node.js SDK on GitHub: retries, timeouts, and error handling.
How is this guide?

