API reference
@fixback/sdk reference
The complete API of
@fixback/sdk. For a narrative walkthrough, see the Web SDK guide.Exports
import { init, Fixback, LAUNCH_EVENT } from "@fixback/sdk";const fixback = await init({ key: "pk_live_…" });await fixback.signIn(); // open Connectfixback.destroy();init(options)— boots the SDK; returns aPromiseresolving to an instance.Fixback— a module-level object withsignIn()/signOut()/identity()that delegate to the most recentinitinstance, so a host app can start a Connect from its own UI.LAUNCH_EVENT— the name of thefixback:launchevent the SDK dispatches when the overlay opens.
init(options)
Returns a promise that resolves to an instance. All options other than key are optional.
| Option | Type | Default | Description |
|---|---|---|---|
key | string | — | Your Project's publishable key (an identifier, not a secret). |
apiUrl | string | https://api.fixback.dev | The Fixback API origin. Override for a self-hosted or local deployment. |
hostIdentity | string | — | A Host identity token minted by your server, for trusted reporters that already have a login. |
anonymousId | string | a persisted per-browser id | A stable first-party id for an anonymous reporter. |
target | HTMLElement | document.body | Where to mount the launcher. |
reduceMotion | boolean | false | Still the launcher's pulse and motion. |
autoCapture | boolean | true | Automatic error capture — file uncaught errors with no prompt. Set false to turn it off. |
capture | { console?, network?, replay? } | served per-project | Console / network Trace capture and session replay. On by default and normally governed per-project; set a stream here to override (e.g. { network: false }). |
enabled | boolean | true | Master switch. false mounts nothing and captures nothing — keep the call in place and gate it by environment. |
release | string | — | The build identifier of the running app. Match it to the release you upload sourcemaps under so errors symbolicate. |
environment | string | — | The deploy environment (production, staging, …) stamped on every capture. |
scrub | boolean | true | Run the built-in URL / PII scrubbers before beforeSend. |
beforeSend | (report) => report | null | — | Reshape or drop (null) any report before transport. |
beforeBreadcrumb | (crumb) => crumb | null | — | Filter or edit Trace entries at the source. |
trace | { budgets?, maxAgeMs?, consoleLevels? } | SDK defaults | Tune the Trace ring buffer. maxAgeMs takes one number for every stream or a per-stream record (network 3 min, console and breadcrumbs 15). To turn a stream off, use capture. |
replay | { windowMs?, … } | SDK defaults | Tune the buffered session-replay window. To turn replay off, use capture.replay. |
The instance & Fixback
init resolves to an instance; the module-level Fixback object exposes
the same Connect methods against the most recent instance.
| Member | Description |
|---|---|
destroy() | Tears the launcher and overlay down and removes the SDK's handlers. |
signIn() | Open Connect — the platform's connect page in a popup (a full redirect when it is blocked) — and bind the person's Account to this site as a Reporter session. Resolves to the resulting identity. |
signOut() | Revoke the Reporter session and forget the token — the person becomes anonymous again. |
identity() | The current identity: { status: "anonymous" } or { status: "connected", name, email, tier }. |
Connect
A reporter is an Account. The overlay's identity chip shows
"Anonymous · Sign in"; clicking it (or calling Fixback.signIn()) opens the
platform's connect page, signs the person in with Google, GitHub, Apple, or an email magic link, and
returns them to your page as their Account — the chip then shows their name and tier. On a gated
Project nothing is shown to a signed-out visitor; entry is a Fixback-issued link's ?fixback= code or a host call to Fixback.signIn().
await init({ key: "pk_live_…" }); // mounts the launcher + identity chip on an Open Project// From your own UI, e.g. a "Report a bug" menu item on a gated Project:await Fixback.signIn();