Browser
Capture exceptions from browser apps with @sentry/browser pointed at Epure.
Use official @sentry/browser 7.120.0 (fixture-proven in CI). Point dsn at your Epure host. No @epure/* package.
Use this guide when the code runs in the user’s tab: React, Vue, Angular, Svelte, Vite/CRA SPAs, static HTML. Do not use this for Express/Nest (→ Node) or Next.js (→ Next.js). Full map: Pick your SDK.
Capture exceptions in the browser
Install @sentry/browser@7.120.0, call Sentry.init once at startup, and allow the page origin in CORS.
Shared DSN, environment, and release options: JavaScript / TypeScript.
How do I install @sentry/browser?
npm install @sentry/browser@7.120.0Pin 7.120.0 for the same line CI exercises. Newer majors may work; confirm with Verify.
Init the browser SDK
Call once at app startup, before any UI that can throw.
import * as Sentry from "@sentry/browser";
Sentry.init({
dsn: "http://YOUR_PUBLIC_KEY@localhost:8080/YOUR_PROJECT_ID",
environment: "production",
release: "my-app@1.0.0",
tracesSampleRate: 0,
profilesSampleRate: 0,
replaysSessionSampleRate: 0,
replaysOnErrorSampleRate: 0,
});| Option | Value |
|---|---|
dsn | Required: public key + Epure host + project UUID |
environment | Tag for the dashboard filter strip |
release | Same string as sourcemap uploads |
tracesSampleRate | 0; transactions discarded |
profilesSampleRate | 0; profiles discarded |
replaysSessionSampleRate / replaysOnErrorSampleRate | 0; replay discarded |
For Sentry JS v8+, also set enableTracing: false when the option exists. There is no session replay product UI.
What is captured automatically?
After init, the SDK hooks:
window.onerror/ uncaught exceptions- Unhandled promise rejections
- Default breadcrumbs (navigation, console, XHR/fetch) when the SDK enables them
You do not need extra wiring for a first uncaught error to reach Issues.
How do I capture handled errors?
Handled failures you still want grouped:
try {
risky();
} catch (error) {
Sentry.captureException(error);
}
Sentry.captureMessage("checkout stalled", "warning");How do I configure CORS?
Browser SDKs POST envelopes cross-origin. Epure answers OPTIONS on ingest (/envelope/, /store/, release files, user feedback).
- Set
EPURE_CORS_ORIGINSto your frontend origin(s), comma-separated (see Self-hosting · Configuration). - Local compose often uses
*. Fine for dev; restrict in production. - Allowed request headers include
X-Sentry-Auth,Content-Type,Content-Encoding.
If the Network tab shows a failed preflight, the origin is missing from EPURE_CORS_ORIGINS.
Auth detail (query sentry_key vs header): API · Authentication.
How do browser source maps work?
Minified production stacks demangle when you upload .map files for the same release. See Source maps.
What is a tunnel?
A same-origin proxy that avoids CORS and keeps the DSN secret off the page.
Your backend forwards the raw envelope to Epure with X-Sentry-Auth. Skip it when CORS is configured.
Why does the browser never send?
| What you see | What to do |
|---|---|
| Failed OPTIONS | Add the page origin to EPURE_CORS_ORIGINS |
| 401 / 403 | Recopy DSN; revoked keys fail closed |
| 202, empty Issues | Environment filter vs environment: "production" |
Next
Are session replays stored?
No. Set replaysSessionSampleRate and replaysOnErrorSampleRate to 0, along with tracing rates. Replay items are discarded on ingest and there is no replay product UI. Confirm with Verify after a throw.
Why does OPTIONS fail?
The page origin is missing from EPURE_CORS_ORIGINS. List the frontend origin as a comma-separated value, then recreate epure. Allowed headers include X-Sentry-Auth and Content-Type. Local compose often uses *, which you should restrict in production: Configuration.