signalpad

Widget SDK

The Signalpad widget exposes a global window.signalpad object after the script loads. All methods are safe to call before the widget finishes initialising; they queue internally and flush once the widget is ready.

Installation

Embed the script in your HTML. One tag, no bundler required.

html
<script
  src="https://www.signalpad.app/widget.js"
  data-project="your_key_here"
  data-api="https://www.signalpad.app"
  data-consent="required"
></script>
AttributeTypeDescription
data-projectrequiredstringYour project key. Found in Dashboard → Settings → Widget.
data-apioptionalstringOverride the API base URL. Defaults to https://www.signalpad.app. Useful for self-hosted instances or local development.
data-consentoptionalstringSet to required for GDPR-style consent gating: the widget collects nothing until you call signalpad.consent("granted"). See Privacy & consent. Omit for default behaviour.
data-environmentoptionalstringTag events with an environment (e.g. production, staging) so you can filter analytics and keep test traffic out of your real numbers.

signalpad.identify(userId, attributes?)

Associates the current session with a known user. Call this after your auth flow resolves. Attributes are stored against the user and used by the targeting engine to decide which releases to show.

signalpad.identify(userId: string, attributes?: Record<string, any>): void
ParameterTypeDescription
userIdstringYour internal user ID. Must be stable across sessions.
attributesobjectOptional. Any JSON-serialisable key-value pairs, such as plan, role, company, created_at, etc. Used for advanced targeting.
javascript
// Basic: user ID only
signalpad.identify("usr_4821");

// With attributes for targeting
signalpad.identify("usr_4821", {
  plan:       "pro",
  role:       "admin",
  company:    "Signalpad",
  created_at: "2024-06-15",
  beta:       true,
});
Important: If you call identify() after track(), previous anonymous events are not retroactively merged. Call identify() as early as possible in your app lifecycle.

signalpad.track(eventName, properties?)

Records a product event. Events auto-register the first time they arrive; no dashboard setup needed. They show up under Events, and you can pick any event as a release’s success event to measure adoption. Calls are batched and sent efficiently in the background.

signalpad.track(eventName: string, properties?: Record<string, any>): void
ParameterTypeDescription
eventNamestringA stable event key. Convention: object.action, past tense (e.g. export.completed).
propertiesobjectOptional. Extra context stored with the event and available as breakdowns. Sensitive keys (email, password, token…) are stripped automatically.
javascript
// Track any product event; it auto-registers
signalpad.track("voice_note.sent");

// With properties (used for breakdowns)
signalpad.track("export.completed", {
  format:     "csv",
  row_count:  1420,
});

// React example: in an event handler
function handleExport() {
  exportData();
  signalpad.track("dashboard.exported");
}

signalpad.register(properties)

Registers “super properties” that are merged into every subsequenttrack() event automatically. Handy for context you want on all events: plan, workspace, app version.

signalpad.register(properties: Record<string, any>): void
javascript
signalpad.register({ plan: "pro", app_version: "2.4.0" });

// Every later event now carries plan + app_version
signalpad.track("export.completed"); // → { plan: "pro", app_version: "2.4.0" }

signalpad.registerElement(key, elementOrRef)

Registers a DOM element under a named key so walkthroughs can spotlight it and a release’s “New” dot can sit on it. Use this instead of fragile CSS selectors: your elements are referenced by stable names regardless of class or ID changes. Adding data-sp="your-key" to the element works too.

signalpad.registerElement(key: string, elementOrRef: HTMLElement | React.RefObject): void
javascript · Vanilla JS
const btn = document.getElementById("record-btn");
signalpad.registerElement("voice-record-btn", btn);
tsx · React
import { useRef, useEffect } from "react";

function RecordButton() {
  const ref = useRef<HTMLButtonElement>(null);

  useEffect(() => {
    // Pass the ref; the SDK reads .current automatically
    signalpad.registerElement("voice-record-btn", ref);
  }, []);

  return <button ref={ref}>Record</button>;
}

The key you register here must match the Element key set on each flow step in the walkthrough builder.

signalpad.open() / signalpad.close()

Programmatically open or close the “What’s new” panel. Useful when your own UI triggers the widget, for example a “Release notes” menu item.

No-code alternative: You can add the data-sp="open" attribute to any element on your site to automatically bind it to the open panel action.

javascript
// Open the list, same as clicking the launcher
signalpad.open();

// Close it
signalpad.close();

// HTML example: Add data-sp="open" to any button to auto-bind it!
// <button data-sp="open">What's New</button>
When the widget is set to Your own button in the dashboard, there’s no launcher in the corner. The list only opens via signalpad.open() or an element with data-sp="open". New releases still reach people as a card, pop-up or “New” dot, as each release chooses.

signalpad.startFlow(id)

Starts a walkthrough programmatically, bypassing the panel UI. Pass a release IDto start the walkthrough attached to that release, or a walkthrough ID for a flow whose trigger is set to Manual. Use this to launch tours from your own buttons, a help menu, or a deep link from an email or notification.

signalpad.startFlow(id: string): void
javascript
// A release's walkthrough: id is the release ID from the dashboard
signalpad.startFlow("f3a1b2c4-d5e6-7890-abcd-ef1234567890");

// Standalone flow with a Manual trigger: id is the flow UUID
document.querySelector("#help-tour").onclick = () =>
  signalpad.startFlow("a1b2c3d4-e5f6-7890-abcd-ef1234567890");

A standalone flow only launches if it is active, its audience targeting matches the current user, and it has not already been completed (for once-per-user / until-completed frequencies). Only one flow runs at a time.

Privacy & consent

Signalpad is a data processor: the widget runs on your site and collects your end-users’ data on your behalf. Two features help you stay compliant (GDPR and similar).

Consent mode

Add data-consent="required" to the script tag and the widget starts in a fully dark state: no cookie, no collection, no network calls that record behaviour, until you callsignalpad.consent("granted"). It also honours the browser’s Do Not Track signal automatically. Callingconsent("denied") clears any queued events and stops tracking. Without the attribute, the widget behaves as before.

PII scrubbing

As a safety net, Signalpad strips personally-identifying data even if it’s passed by mistake. Sensitive property keys (email, password, token, ssn, card fields, and more) are dropped, email-shaped values are redacted, and sensitive URL query params (?token=, ?email=…) are removed from captured page URLs. Scrubbing runs both in the widget before sending and again on our servers at ingest.

Note:you remain the data controller; you’re responsible for your consent UI and legal basis. Signalpad provides the technical controls and a DPA.

Welcome-back recap Pro+

The widget announces at most one release per visit, so someone who comes back after two weeks won’t get a string of pop-ups. The recap covers the rest: when they open the list, one line on top says how much changed since they were last here, and every release they missed is right below it, ready to react to or start a walkthrough from.

Turn it on in Dashboard → Setup → Widget → Welcome-back recap and choose how many days away count as a break (catch_up_away_days, 7 by default). The widget checks each load against the person’s last_seen_at; no code changes needed.

Shown once per batch:after the recap has shown for a set of releases, that’s recorded in localStorageand it isn’t shown again for the same releases. The list never opens by itself; the recap waits until they open it.

Widget configuration

All widget configuration is managed from the dashboard, not in code. The widget reads its config on load from /api/sdk/config?key=YOUR_PROJECT_KEY. Changes in the dashboard take effect on the next page load.

OptionValuesDescription
positionbottom-right · bottom-left · top-right · top-leftWhich corner the launcher, list and cards sit in.
themelight · dark · autoauto intelligently sniffs your host page for class="dark" or data-theme="dark" to instantly match your app's theme. If none are found, it falls back to the user’s OS preference via prefers-color-scheme.
triggeron_click · on_eventon_click shows a launcher in the corner with a count; it opens the list. on_event hides the launcher, so the list opens only via signalpad.open() or data-sp="open". The list never opens by itself; older projects set to on_load behave like on_click. Each release chooses whether it also shows as a card or pop-up.
custom_cssstringInjected as a <style> tag after the widget’s default styles. Use it to override colours, border-radius, font.
catch_up_enabledPro+booleanWhen true, returning users who’ve been away for catch_up_away_days+ days see a “Here’s what you missed” summary on first open.
catch_up_away_daysPro+numberHow many days away count as a break for the welcome-back recap. Default: 7.