Browser SDK
Installing @accelerup-llc/web-monitor, and the two production mistakes worth knowing about first.
@accelerup-llc/web-monitor reports browser errors, warnings, network failures
and spans to AccelerUp.
Install
npm install @accelerup-llc/web-monitorimport { init } from '@accelerup-llc/web-monitor';
init({
ingestUrl: 'https://monitoring.qrdev.org/ingest',
key: 'YOUR_INGEST_KEY',
release: process.env.NEXT_PUBLIC_RELEASE, // ties errors to a release
environment: 'production',
sampleRate: 1.0,
});| Option | Purpose |
|---|---|
ingestUrl | The /ingest base |
key | Ingest key — see Ingest endpoints |
release | Set this. It is what links an error group to the release that introduced it |
environment | Keeps staging noise out of production |
sampleRate | 1.0 while you are establishing a baseline |
Two production mistakes
These both happened. Neither is obvious, and both were expensive to diagnose.
The traceparent leak
The SDK adds a traceparent header for distributed tracing. On a cross-origin
request to a third party that does not allow that header, the browser's preflight
fails — and the request never happens.
The symptom is not an error in your code. It is a third-party integration
silently not loading: a payment iframe that never appears, a social login that
does nothing. Configure the SDK to add traceparent only to your own
origins.
CORS on the ingest endpoint
If ALLOWED_ORIGINS does not include the site the SDK runs on, every ingest
request fails preflight. The SDK then reports nothing at all — and an SDK
reporting nothing looks exactly like an application with no errors.
After deploying the SDK, deliberately throw an error in a staging build and confirm it appears in Error groups. An SDK that is not reporting is indistinguishable from healthy code.
Source maps
Upload the map for each build so stacks resolve to your source:
curl -X POST https://monitoring.qrdev.org/ingest/sourcemaps \
-H "X-Ingest-Key: $KEY" \
-F "release=$RELEASE" \
-F "file=@dist/main.js.map"Do this in the build, not by hand. A map that does not match the deployed bundle resolves to the wrong lines, which sends people to code that is not running.
Privacy
Set WEB_INGEST_SCRUB_PII and WEB_INGEST_SCRUB_IP server-side. Scrubbing
happens before the first write, so a scrubbed field was never stored.
What it reports
| Appears in | |
|---|---|
| Uncaught errors and rejections | Error groups |
console.warn / console.error | Error groups |
| Failed network requests | Network errors |
| Performance spans | APM |
| Session metadata | Session context on each error |
Feature flags
The same package carries the feature-flag client, so a page that already has the SDK can evaluate flags without a second dependency.
Where this behaviour lives: backend/internal/handler/web_ingest_handler.go. If the code and this page disagree, the code is right — please fix the page.
Part of Logs and errors — What the software said about itself, and what was unusual about it.