@sequenzy/web-sdk
v0.1.0
Published
Browser tracking SDK for anonymous and identified on-site events
Maintainers
Readme
@sequenzy/web-sdk
Browser SDK for sending product views, cart activity, collection views, and search events to Sequenzy.
npm install @sequenzy/web-sdkimport { createBrowserClient } from "@sequenzy/web-sdk";
const sequenzy = createBrowserClient({
publicKey: "seq_pk_your_key",
companyId: "your_workspace_id",
});
// Mint this on your authenticated backend via POST
// /api/v1/web-tracking-identities. Never expose your secret API key here.
sequenzy.identify("[email protected]", identityToken);
sequenzy.viewedProduct({
providerProductId: "product-123",
title: "Example product",
});Call reset() when a visitor signs out. Use the paste-ready hosted script from
the Sequenzy dashboard if you do not bundle JavaScript with your site.
Test page
A fake shop page that installs the SDK exactly the way the hosted snippet does, then narrates in plain English what it sends.
bun run --filter @sequenzy/web-sdk harness # http://localhost:5273Paste a publishable key and workspace id, press Start tracking, and click
things. Add http://localhost:5273 to that key's allowed origins first, or
every event comes back 403.
The server rebuilds /sequenzy.js from src/ on each request, so the page
always exercises the working tree. Everything else - stored state, forged
tokens, raw track(), the failure scenarios - lives under Advanced.
