Quick start

From nothing to a ranked catalogue in about ten lines.

Get your keys

Sign in to the dashboard and open Integration → API keys. Create a key, name it for where it will run, and copy it immediately.

Shown once

The full key is returned only at creation. Only its hash is stored. If you lose it, revoke it and create another.

Your organization id is on the same page. You need both.

Install

pnpm add @thepulseapi/sdk

Start a session

pulse.ts
import { PulseClient } from '@thepulseapi/sdk';

export const pulse = new PulseClient();

await pulse.init({
  apiKey: 'pk_live_...',
  organizationId: 'org_...',
});

init() also captures device, referrer and time of day once per session, unless you pass autoTrack: false.

Send what the shopper did

await pulse.track([
  { type: 'category_view', value: 'helmets-safety' },
  { type: 'price_filter', value: '500000-1500000' },
]);

Rank your catalogue

const { results } = await pulse.search(products);

results[0].scoreBreakdown; // why this one came first

Every result carries the signals that matched it, so you can show a shopper why, or show yourself why when it looks wrong.

Without a bundler

index.html
<script src="https://cdn.thepulseapi.com/sdk/v0/pulse.iife.js"></script>
<script>
  Pulse.init({ apiKey: 'pk_live_...', organizationId: 'org_...' });
</script>

On this page