@belvador/react 0.1.0 → 0.2.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
@@ -48,6 +48,14 @@ 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
+ ## Check the connection
52
+
53
+ "No errors" is not proof that errors arrive. Call `verifyIntegration()` from `@belvador/react` once after `init`:
54
+ it sends one marked test error (never an issue), reads it back and resolves to
55
+ `{ outcome: "verified" | "problem" | "unconfirmed", checks, docsUrl, … }`. It never throws.
56
+ Requests the visitor cancelled (`AbortError`) are not reported unless you set `captureAborted: true`.
57
+ See https://belvador.dev/docs/sdk/verify
58
+
51
59
  ## Status
52
60
 
53
61
  `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.2.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.2.0",
41
+ "@belvador/core": "0.2.0",
42
42
  "@sentry/react": "10.76.2"
43
43
  },
44
44
  "publishConfig": {