Skip to main content
@tolt/tracking injects tolt.js for you and gives you typed access to the referral and the signup call. Same script, same cookies, no <script> tag to manage.
tolt.js useTolt()signup(id) Tolt
Returned by useTolt()
hookReact
dataToltData | null
readytrue
signup(identifier) => …
Inside data
ToltDataref=sam
click_id
partner_id
program_id
customer_id

Install

You need your public key from Dashboard → Settings → Integrations. React is an optional peer dependency (17+).

Use it

Render ToltTracking once near the root. It renders nothing.
app.tsx
Then bind the signup once your own signup succeeds:
track-signup.ts
If the page navigates away right after signup, bind on the next page instead, or from your server with POST /v2/customers.

API

Vanilla (@tolt/tracking)

scriptUrl defaults to https://cdn.tolt.io/v2/tolt.js. ToltData has the fields described on the tolt.js page.

React (@tolt/tracking/react)

Unlike window.tolt.signup(), the package’s signup() rejects when tolt.js isn’t loaded yet. Gate on ready from useTolt(), or await init() first.