Skip to content

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 ​

  1. Install the package:

    bash
    npm install @quickpipeaiab/lead-scoring
  2. Make one client for your application. Use the publishable key from QuickPipe, under Settings, then Tracking:

    ts
    import { createClient } from '@quickpipeaiab/lead-scoring';
    
    export const lg = createClient({ key: 'lg-pub-live-…' });
  3. Send an event:

    ts
    lg.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:

bash
npx lead-scoring types --key lg-sec-live-… --out lead-scoring.d.ts

Then give the type to the client:

ts
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.