~12 KB gzipped autoload. Captures unhandled errors, unhandled promise rejections, console errors, optional fetch breadcrumbs. Source-map auto-resolution if you upload them at release time.
Drop this in your <head>. Works without a bundler.
<script
src="https://cdn.coderadar.app/v1/sdk.js"
data-project="truecom"
data-env="production"
data-release="[email protected]"
data-traces-sample-rate="0.2"
defer>
</script>
pnpm add @coderadar/browser
import { init } from "@coderadar/browser";
init({
dsn: "https://[email protected]/12",
project: "truecom",
environment: "production",
release: "[email protected]",
tracesSampleRate: 0.2,
});
window.addEventListener("error").window.addEventListener("unhandledrejection").console.error() is called (off by default; opt in via captureConsole: ["error"]).fetch() call (URL, method, status, duration). On by default.traceparent header.import { captureException, captureMessage, setUser, addBreadcrumb } from "@coderadar/browser";
setUser({ id: user.id });
addBreadcrumb({ category: "ui.click", message: "checkout button" });
try {
await processPayment();
} catch (e) {
captureException(e);
}
Upload them at release time so stack traces resolve to original source. The CLI is the easiest way:
pnpm dlx @coderadar/cli sourcemaps upload \
--project=truecom --release=truecom@$SHA \
--rewrite --strip-common-prefix \
dist/static/js/
The SDK sends the release tag with each event so the dashboard can match the right map.
Add https://ingest.coderadar.app to connect-src in your CSP. The SDK sends no third-party requests. No cookies are set.