Telemetry is in early access. To turn it on for your workspace, book a call or ask in Discord.
@superlog/browser: error capture, breadcrumbs, user and attributes, sessions,fetchandXMLHttpRequesttracing, navigations, and Web Vitals.@superlog/react: an error boundary, React 19 root error handlers, and route patterns from React Router.@superlog/sourcemaps: a Vite plugin and a CLI that upload your source maps, so errors show and group by the original code.
Install
Create an ingest key
The SDK sends to Superlog with an ingest key. Create one for the app. See Create an ingest key. The key ships in your page’s JavaScript, so anyone who loads the page can read it. An ingest key can only add telemetry to your workspace. It can’t read data or change settings. Use a separate key for each app, so you can revoke one without affecting the others.Start the SDK
Callinit before the app renders. The SDK sends to https://superlog.sh/api/ingest by default. For a workspace in the US region, set endpoint to https://us.superlog.sh/api/ingest. The SDK adds /v1/logs and /v1/traces to it.
serviceis sent asservice.name,releaseasservice.version, andenvironmentasdeployment.environment.name.ignoreUrlskeeps requests, such as analytics, out of traces and breadcrumbs.tracesSampleRatekeeps a share of traces, from 0 to 1. Errors are always sent.beforeSendcan change or drop any error, andbeforeBreadcrumbany breadcrumb.
React
Add the error handlers to your root and instrument the router so errors carry the route pattern:SuperlogRoutes in place of <Routes>:
@superlog/react needs React 18 or later, and React Router 6.4 or later for the router integration.
Capture errors yourself
Upload source maps
Source maps let Superlog map minified stack frames back to the original file, line, and function before it groups errors. Uploads use a workspace API key from Settings → API keys, not the ingest key. With Vite, add the plugin:vite.config.ts
SUPERLOG_API_KEY, and deletes them from the output. A failed upload is printed and the build still succeeds. Set failOnError: true to fail the build instead.
For other bundlers, run the CLI on the build output:
https://superlog.sh. For a workspace in the US region, pass url: "https://us.superlog.sh" to the plugin, or --url https://us.superlog.sh to the CLI.
What gets captured
Each error is an OpenTelemetry log record at ERROR severity, so it appears in Errors and Logs. It carries:
The SDK also sends:
- Spans for
fetchandXMLHttpRequestcalls, which appear in Traces. - Logs for page loads and navigations, page load timing, and Web Vitals (LCP, INP, CLS, FCP, and TTFB).
Script error.without details, and the ResizeObserver loop notice.- Errors whose frames all come from browser extensions or from
denyUrls. - Errors that match
ignoreErrors. - The same error repeated within a second.
- Errors past 30 per minute. Change this with
maxErrorsPerMinute.