@belvador/react 0.1.0 → 0.3.0

This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
package/README.md CHANGED
@@ -35,7 +35,7 @@ Everything in `@belvador/browser` is exported here too.
35
35
  ## What it sends
36
36
 
37
37
  Errors only (exceptions, messages, breadcrumbs you turn on, attachments if you enable them).
38
- No tracing, session replay, logs or profiling — those items are dropped inside your app.
38
+ No spans, session replay, logs, profiling or check-ins — those items are dropped inside your app.
39
39
 
40
40
  Before anything leaves your app the SDK removes `Authorization`, `Cookie` and `Set-Cookie`
41
41
  headers, request bodies and cookies, client IP headers, and masks credentials in URLs, query
@@ -48,6 +48,24 @@ each attempt times out after 10 s, failed sends retry at most 5 times, `429` rat
48
48
  respected, and a revoked key (`401`/`403`) stops sending for the life of the page or isolate.
49
49
  Every public function catches its own errors.
50
50
 
51
+ ## Link requests with one trace
52
+
53
+ Off by default. `tracePropagation: { targets: [/^\/api\//, "https://api.example.com"] }` adds
54
+ `traceparent` and `sentry-trace` headers to `fetch` calls to those URLs (relative patterns
55
+ match same-origin paths), so a browser error and the server error behind the same request
56
+ share one trace id. The receiving API must allow these headers in CORS. No spans or
57
+ transactions are sent; `baggage` only with `baggage: true`. A View Transition the browser
58
+ skipped on purpose is not reported unless you set `captureViewTransitionSkips: true`.
59
+ See https://belvador.dev/docs/sdk/tracing
60
+
61
+ ## Check the connection
62
+
63
+ "No errors" is not proof that errors arrive. Call `verifyIntegration()` from `@belvador/react` once after `init`:
64
+ it sends one marked test error (never an issue), reads it back and resolves to
65
+ `{ outcome: "verified" | "problem" | "unconfirmed", checks, docsUrl, … }`. It never throws.
66
+ Requests the visitor cancelled (`AbortError`) are not reported unless you set `captureAborted: true`.
67
+ See https://belvador.dev/docs/sdk/verify
68
+
51
69
  ## Status
52
70
 
53
71
  `0.x` — used by Belvador's own apps first. The API may still change before `1.0`.
package/dist/index.d.ts CHANGED
@@ -1,9 +1,10 @@
1
1
  import type { ErrorBoundaryProps as EngineErrorBoundaryProps } from "@sentry/react";
2
2
  import { type ComponentType, type FC, type ReactElement } from "react";
3
- import type { BrowserOptions } from "@belvador/browser/internal";
3
+ import { type BrowserOptions } from "@belvador/browser/internal";
4
+ import type { VerificationResult, VerifyOptions } from "@belvador/core";
4
5
  export type ReactOptions = BrowserOptions;
5
6
  export type { FallbackRender } from "@sentry/react";
6
- export { SDK_VERSION, addBreadcrumb, captureException, captureMessage, close, flush, lastEventId, setContext, setTag, setTags, setUser, withScope, type BelvadorBreadcrumb, type BelvadorEvent, type BelvadorEventHint, type Scope, type SeverityLevel, } from "@belvador/core";
7
+ export { SDK_VERSION, addBreadcrumb, captureException, captureMessage, close, flush, getDiagnostics, lastEventId, setContext, setTag, setTags, setUser, withScope, type BelvadorBreadcrumb, type BelvadorEvent, type BelvadorEventHint, type Diagnostic, type DiagnosticCode, type DiagnosticsSnapshot, type Scope, type SeverityLevel, type VerificationResult, type VerifyOptions, } from "@belvador/core";
7
8
  /**
8
9
  * Engine boundary props without the report dialog: it loads a script from
9
10
  * the DSN host, which Belvador never does (spec 01 §3).
@@ -23,3 +24,8 @@ export declare function reactErrorHandler(callback?: (error: unknown, errorInfo:
23
24
  }, eventId: string) => void): (error: unknown, errorInfo: {
24
25
  componentStack?: string;
25
26
  }) => void;
27
+ /**
28
+ * Proves this app reports to Belvador from the browser: a captured and an uncaught
29
+ * verification error, read back from Belvador. Never automatic; always resolves.
30
+ */
31
+ export declare function verifyIntegration(options?: VerifyOptions): Promise<VerificationResult>;
package/dist/index.js CHANGED
@@ -3,8 +3,9 @@
3
3
  // privacy and sending rules. Importing this module does nothing until init().
4
4
  import { ErrorBoundary as EngineErrorBoundary, reactErrorHandler as engineReactErrorHandler, withErrorBoundary as engineWithErrorBoundary, } from "@sentry/react";
5
5
  import { createElement } from "react";
6
+ import { verifyBrowser } from "@belvador/browser/internal";
6
7
  import { initReact } from "./internal.js";
7
- export { SDK_VERSION, addBreadcrumb, captureException, captureMessage, close, flush, lastEventId, setContext, setTag, setTags, setUser, withScope, } from "@belvador/core";
8
+ export { SDK_VERSION, addBreadcrumb, captureException, captureMessage, close, flush, getDiagnostics, lastEventId, setContext, setTag, setTags, setUser, withScope, } from "@belvador/core";
8
9
  function withoutDialog(props) {
9
10
  const { showDialog: _show, dialogOptions: _dialog, ...rest } = props;
10
11
  return rest;
@@ -35,3 +36,10 @@ export function reactErrorHandler(callback) {
35
36
  }
36
37
  };
37
38
  }
39
+ /**
40
+ * Proves this app reports to Belvador from the browser: a captured and an uncaught
41
+ * verification error, read back from Belvador. Never automatic; always resolves.
42
+ */
43
+ export function verifyIntegration(options) {
44
+ return verifyBrowser(options);
45
+ }
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "@belvador/react",
3
- "version": "0.1.0",
3
+ "version": "0.3.0",
4
4
  "description": "Belvador error tracking for React 18/19: ErrorBoundary and root error handlers, errors only, private by default.",
5
5
  "license": "MIT",
6
6
  "author": "Belvador (https://belvador.dev)",
@@ -37,8 +37,8 @@
37
37
  "node": ">=18"
38
38
  },
39
39
  "dependencies": {
40
- "@belvador/browser": "0.1.0",
41
- "@belvador/core": "0.1.0",
40
+ "@belvador/browser": "0.3.0",
41
+ "@belvador/core": "0.3.0",
42
42
  "@sentry/react": "10.76.2"
43
43
  },
44
44
  "publishConfig": {