Package Exports
- @vemetric/node
- @vemetric/node/dist/index.js
- @vemetric/node/dist/index.mjs
This package does not declare an exports field, so the exports above have been automatically detected and optimized by JSPM instead. If any package subpath is missing, it is recommended to post an issue to the original package (@vemetric/node) to support the "exports" field. If that is not possible, create a JSPM override to customize the exports field for this package.
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
});