@kitesdk/node
v0.1.1
Published
Send product events and customer traits to Kite from Node.js.
Downloads
578
Maintainers
Readme
Kite Node.js SDK
Send product events and customer traits to Kite from server-side Node.js applications.
What is Kite?
Kite is an event-driven Customer Success as Code engine. Your team defines activation, lifecycle, journeys, segments, health, and churn-risk logic as versioned TypeScript. Kite evaluates product events against those definitions to compute deterministic, explainable customer state.
This SDK is the server-side data layer: use it to identify customers and send the product activity that powers Kite's state engine.
Install
Kite requires Node.js 20 or newer.
npm install @kitesdk/nodeTrack events
import { Kite } from '@kitesdk/node';
const kite = new Kite({
apiKey: process.env.KITE_API_KEY!,
onError(error) {
console.error('Kite delivery failed', error);
},
});
await kite.track({
customerId: 'customer_123',
event: 'report.created',
properties: { format: 'pdf' },
idempotencyKey: 'report_456_created',
});Identify customers
await kite.identify({
customerId: 'customer_123',
traits: { plan: 'growth', seats: 12 },
});Batch operations
await kite.batch([
{ type: 'identify', customerId: 'customer_123', traits: { plan: 'growth' } },
{ type: 'track', customerId: 'customer_123', event: 'workspace.invited' },
]);The SDK retries network errors, HTTP 429, and HTTP 5xx responses. With retries
enabled it generates idempotency keys when none are supplied. Delivery methods
do not throw request errors; they return undefined and report the error to
onError.
API keys are server-side credentials. Never include them in browser bundles.
Resources
License and terms
This package is provided under the Kite Software License. Use of Kite Cloud and related services is also governed by the Kite Terms of Service.
