SDKs
Node.js SDK (server api)
Quickly integrate the Ours Privacy Node.js SDK using npm. Explore its features with our Interactive API Explorer.
Ours Privacy Node.js SDK Documentation
This is a quick start guide for integrating the Ours Privacy Node.js SDK (nodejs/typescript) into your server-side applications.
Installation
Install the SDK via npm:
npm install @oursprivacy/server-sdkFor more details, visit the NPM Repo | Github Repo.
Usage
Initialize the SDK and send events with just a few lines of code:
import OursPrivacy from '@oursprivacy/server-sdk';
const client = new OursPrivacy();
// Track an event
await client.track.event({
token: 'your-api-key',
event: 'Purchase',
userId: 'user123'
});
// Identify a user
await client.identify.visitor({
token: 'your-api-key',
userId: 'user123',
userProperties: {
email: 'user@example.com',
firstName: 'John',
lastName: 'Doe'
}
});Explore the API
Want to see what the SDK can do? Try our Interactive API Explorer to experiment with endpoints and features in real time.
How is this guide?