@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.
Returned by useTolt()
hookReact
dataToltData | null
readytrue
signup(identifier) => …
Inside data
ToltDataref=sam
click_id
partner_id
program_id
customer_id
Install
Use it
- React
- Next.js
- Vanilla
Render Then bind the signup once your own signup succeeds:If the page navigates away right after signup, bind on the next page instead, or from your server with
ToltTracking once near the root. It renders nothing.app.tsx
track-signup.ts
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.
