Skip to content

Documentation

Configuration

Every wutbug.init() option, with its type, default value and what it does.

wutbug.init(options) takes an object. Only projectKey is required. Appearance options can also be edited in the dashboard: whatever you pass in code always wins over the dashboard (see Appearance).

TypeScript
import wutbug from '@wutbug/sdk';

wutbug.init({
  projectKey: 'pk_your_key',
  endpoint: 'https://api.wutbug.dev',
  release: '2026.11.3',
  locale: 'en',
  position: 'bottom-right',
  launcherLabel: 'Something not working?',
  theme: { accent: '#ea580c', mode: 'auto', radius: 'round' },
  privacy: { redactKeys: ['ssn', 'dni'], blockSelector: '.card-details' },
  ignoreUrls: ['https://analytics.example.com', /\/health$/],
  beforeSend: (report) => report,
});

General options

OptionTypeDefaultDescription
projectKeystring—Required. The project's public key (pk_…).
endpointstring—Wutbug API URL. Without it, the SDK works in local mode: it downloads the report as JSON instead of sending it.
releasestring—Your app's version (commit SHA or 2026.11.3). Must match the one you use when uploading source maps. Maximum 100 characters.
locale'en' | 'es' | 'auto''auto'Widget language. auto uses navigator.language (Spanish if it starts with es, otherwise English).
position'bottom-right' | 'bottom-left' | 'top-right' | 'top-left''bottom-right'Corner of the floating button. The form opens from the same corner.
launcherbooleantruefalse hides the floating button. Open the form with wutbug.open() or an element with data-wutbug-open.
launcherLabelstring—Button text. Empty: icon only, and the text appears on hover.
themeobjectsee belowColors, light/dark mode, corners and font.
remoteConfigbooleantrueDownloads the appearance configured in the dashboard. false uses only what you set in code.
bufferMsnumber120000How much history (in ms) is kept in memory for replay, console and network.
captureobjectall trueWhat gets captured: { replay, console, network }.
privacyobjectsee belowMasking and redaction. See Privacy.
ignoreUrls(string | RegExp)[][]Requests that are never recorded. A string is matched as a URL prefix.
beforeSend(report) => report | null—Last chance to edit the report or discard it (return null). Can be async.
autoCaptureobject{ mode: 'off' }Automatic or suggested reports when an error occurs. Wins over the dashboard configuration, field by field. See Auto-capture.
debugbooleanfalseLogs the SDK's internal activity to the console.

theme

OptionTypeDefaultDescription
accentstring (hex)#6d5dfcMain color: floating button, buttons and focus.
accentDarkstring (hex)#8b7dffMain color in dark mode. If you set accent in code and not accentDark, accent is used in both modes.
mode'auto' | 'light' | 'dark''auto'auto follows the user's system preference.
radius'sharp' | 'default' | 'round''default'Corner rounding.
font'system' | 'inherit''system'inherit uses your page's font instead of the system font.

The text color on the button (white or black) is chosen automatically, based on contrast with accent.

capture

OptionTypeDefaultDescription
replaybooleantrueRecords the DOM with rrweb (loaded when the browser is idle).
consolebooleantrueRecords console.*, uncaught errors, rejected promises and resources that failed to load.
networkbooleantrueRecords fetch and XMLHttpRequest.
behaviorbooleantrueBehavior signals: rage clicks, dead clicks, long tasks and Web Vitals. See Auto-capture.

privacy

OptionTypeDefaultDescription
maskAllInputsbooleantrueMasks the value of all inputs, textareas and selects in the replay and screenshot. Passwords are always masked.
maskTextSelectorstring—Additional CSS selector whose text is masked (besides .wutbug-mask).
blockSelectorstring—Additional CSS selector for elements that are hidden completely (besides .wutbug-block).
redactHeadersstring[]see PrivacyHeaders whose value is replaced with [REDACTED]. They are added to the defaults.
redactKeysstring[]see PrivacyRegex sources (case-insensitive) for JSON key names, form fields and URL parameters. They are added to the defaults.
redactPatternsRegExp[][]Extra expressions that are replaced in all captured text (console, URLs, bodies).
captureBodiesbooleantrueCaptures request and response bodies. false stores only method, URL, status, timings and headers.
maxBodyLengthnumber10000Maximum characters per body. Anything beyond that is truncated.

beforeSend

Receives the complete report right before it is sent. Return the report (modified or not) to send it, or null to discard it. If the function throws, the report is not sent.

TypeScript
wutbug.init({
  projectKey: 'pk_your_key',
  endpoint: 'https://api.wutbug.dev',
  beforeSend(report) {
    // Don't send reports from test environments
    if (location.hostname.endsWith('.local')) return null;
    // Remove a field from the metadata
    delete report.metadata.internalId;
    return report;
  },
});

The report includes description, reporterEmail, environment, user, metadata, console, network, replay, screenshot and video. See Captured data.

Precedence

  1. Options passed to init() in code.
  2. Appearance saved in the dashboard (if remoteConfig is true).
  3. Default values.

The dashboard appearance is downloaded from GET /v1/widget-config and cached for 5 minutes per tab, so changes reach your users without redeploying.