Skip to content

SDK options

All options accepted by init() from @opslane/sdk, mirrored from SdkInitOptions and the defaults object in packages/sdk/src/config.ts. The drift check fails the repository test gate (pnpm test, which CI runs) if the type and this page disagree.

OptionTypeDefaultDescription
apiKeystring(required)Per-environment ingest key. init refuses to start without it.
endpointstringhttps://api.opslane.comYour Opslane instance; validated as an http(s) URL.
releasestring''Immutable build identifier (git SHA); must match uploaded source maps.
maxBreadcrumbsnumber50Ring-buffer size for breadcrumbs attached to each event.
breadcrumbMaxAgenumber30000Milliseconds before a breadcrumb is considered stale and dropped.
flushIntervalnumber5000Milliseconds between transport flushes.
maxBatchSizenumber10Maximum events per flush.
debugbooleanfalseLog SDK-internal problems to the console.
replay{ enabled?: boolean }{ enabled: true }Session recording. On by default since 1.0.0. Set enabled: false to opt out; a per-project kill switch also exists server-side. Needs CompressionStream (Chrome 80+, Safari 16.4+, Firefox 113+).
sampleRatenumber1Fraction of events sent; clamped to [0, 1].
errorThrottleMsnumber1000Minimum interval between reports of the same error.
beforeSend(event) => event | nullundefinedFinal hook: mutate the outgoing payload or return null to drop it.

Related exports: captureException(err), setUser({ id }), clearUser(), destroy(), opslaneVuePlugin, and (from @opslane/sdk/react) OpslaneErrorBoundary / captureReactError. Build-time source-map upload lives in @opslane/sdk/vite-plugin — see the SDK README.