@vemetric/node
v0.2.0
Published
Official Node.js, Bun, Deno SDK for Vemetric
Maintainers
Readme
The Vemetric SDK for Node.js, Bun and Deno
Learn more about the Vemetric Node.js SDK in the official docs.
You can also checkout the NPM Package.
Installation
npm install @vemetric/nodeUsage
import { Vemetric } from '@vemetric/node';
const vemetric = new Vemetric({
token: 'YOUR_PROJECT_TOKEN',
});
// Track an event
await vemetric.trackEvent('MyCustomEvent', {
userIdentifier: 'user-id',
userDisplayName: 'John Doe',
eventData: { key: 'value' },
});
// Update user data
await vemetric.updateUser({
userIdentifier: 'user-id',
userData: {
set: { key1: 'value1' },
setOnce: { key2: 'value2' },
unset: ['key3'],
},
});Configuration
The client can be configured with the following options:
const vemetric = new Vemetric({
token: 'YOUR_PROJECT_TOKEN', // Required
host: 'https://hub.vemetric.com', // Optional, defaults to https://hub.vemetric.com
});