Install with npm
Use the npm package in a web application, in a Node.js server or in an edge function. The package uses only @quickpipeaiab/normalizers for the identifier values. The whole client is smaller than 15 KB after gzip.
Procedure
Install the package:
bashnpm install @quickpipeaiab/lead-scoringMake one client for your application. Use the publishable key from QuickPipe, under Settings, then Tracking:
tsimport { createClient } from '@quickpipeaiab/lead-scoring'; export const lg = createClient({ key: 'lg-pub-live-…' });Send an event:
tslg.track('pricing.viewed', { plan: 'pro' });
Result
The client sends page views, form submits, clicks and the scroll depth automatically, with the same defaults as the script tag. It sends your own events in batches. Refer to the configuration reference for all options.
Types for your events
You can get TypeScript types for the event names and properties that QuickPipe already received:
npx lead-scoring types --key lg-sec-live-… --out lead-scoring.d.tsThen give the type to the client:
import type { Events } from './lead-scoring';
export const lg = createClient<Events>({ key: 'lg-pub-live-…' });The editor then completes the known names and checks their properties. A new event name also compiles.
On a server
On a server, use a secret key and give the person of each event. Refer to Send server events.