Developer & SDK
The Spectry SDKs: browser configuration and JavaScript API, the Node.js server SDK, custom events, user identification and masking.
In this section.
Content Security Policies
SDK overview & configuration
How the Spectry browser SDK loads, what it collects automatically, and how to configure it.
Track custom events
Send your own events from code with Spectry.track(), including e-commerce events.
Identify logged-in users
Attach a stable user ID and traits to a visitor with Spectry.identify().
Event context and variables
Set visitor state once and have it attached to every event — then segment and build funnels on both event properties and context.
No-code event builder
Define custom events visually — from clicks, scroll depth, time on page or frustration signals — without writing code.
Feature flags in code
Read feature-flag values in your application with Spectry.getFlag().
Node.js SDK
Install @spectry/spectry, read feature flags and send events from your backend.
Node.js SDK reference
Every option, method and return value in @spectry/spectry.
Serve the SDK from your own domain
Route spectry.js and its events through your own domain so content blockers treat them as first-party - and keep the SDK updating itself.
Privacy masking & data attributes
How Spectry automatically masks sensitive data, and the data attributes you can use to control it.
JavaScript API reference
A complete reference of the window.Spectry methods.
Connect AI to Spectry (MCP)
Point Claude, an IDE agent or your own tooling at Spectry and ask about your sites in plain language.
MCP tokens & scopes
Create, scope, restrict and revoke the tokens that let an AI client reach your Spectry data.
Can't find what you're looking for?
Our support team is always happy to help.