@remetry/browser
v1.1.0
Published
Remetry browser SDK — error, performance, API and session-replay monitoring for web apps.
Readme
@remetry/browser
Browser SDK for Remetry — error, performance, API and session-replay monitoring for web apps. ESM-only.
Install
npm install @remetry/browser
# session replay is optional and lazy-loaded:
npm install [email protected]Quick start
import { init, errorsPlugin, performancePlugin, apiPlugin, replayPlugin } from "@remetry/browser";
init({
dsn: "<your-public-dsn>",
endpoint: "https://<your-ingest-host>/ingest/events",
release: "1.0.0",
integrations: [errorsPlugin(), performancePlugin(), apiPlugin(), replayPlugin()],
});React error boundary (separate entry, so non-React hosts never pull in React):
import { ErrorBoundary } from "@remetry/browser/react";
<ErrorBoundary fallback={<Crashed />}>
<App />
</ErrorBoundary>;Entry points
@remetry/browser—init,captureError,captureEvent,flush,getSessionId,shutdown,getClient, plus theerrorsPlugin,performancePlugin,apiPluginandreplayPluginintegrations.@remetry/browser/react—ErrorBoundary.
Peer dependencies
react(optional) — only for the/reactentry.[email protected](optional) — only when you usereplayPlugin(); loaded dynamically.
Development
pnpm install
pnpm test # vitest (jsdom)
pnpm typecheck
pnpm build # tsup -> dist/ (ESM + bundled .d.ts)The wire-format types live in src/contracts/ — an inlined copy of the
@remetry/contracts package from the Remetry monorepo. They are bundled into
dist at build time (tsup noExternal + dts.resolve), so the published
package has zero @remetry/* dependencies. The two entry points share one
chunk via code-splitting, so init() and the React <ErrorBoundary> bind to
the same client instance.
Releases & versioning
Releases are fully automated with semantic-release. Every push to main:
- analyzes commit messages (Conventional Commits),
- computes the next version (
fix:→ patch,feat:→ minor,feat!:/BREAKING CHANGE:→ major), - builds, publishes to npm, tags the release, and updates
CHANGELOG.md+ the GitHub release.
There is no manual version bump — the version in package.json is a
placeholder. The first release on a fresh repo publishes 1.0.0.
Commit examples:
| Commit | Bump |
| --- | --- |
| fix: guard against missing navigator | patch |
| feat: add offline event buffering | minor |
| feat!: rename endpoint option | major |
Required GitHub repo secrets
| Secret | Purpose |
| --- | --- |
| NPM_TOKEN | npm automation token with publish rights to the @remetry org |
| GITHUB_TOKEN | provided automatically by GitHub Actions (no setup) |
npm provenance (optional): for a public repo you can add
"provenance": truetopublishConfigandNPM_CONFIG_PROVENANCE: "true"to the release job to get a verified npm provenance badge. Leave it off for private repos.
License
See LICENSE.md (FSL-1.1-ALv2).
