@xrayradar/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 ADDED
@@ -0,0 +1,46 @@
1
+ # @xrayradar/react
2
+
3
+ [![npm](https://img.shields.io/npm/v/%40xrayradar%2Freact?style=flat-square)](https://www.npmjs.com/package/@xrayradar/react)
4
+ ![React](https://img.shields.io/badge/react-%3E%3D17-brightgreen?style=flat-square)
5
+
6
+ XrayRadar SDK for **React** – ErrorBoundary, XrayRadarProvider, useXrayRadar, and re-exports from **@xrayradar/browser** for [XrayRadar](https://xrayradar.com) error tracking.
7
+
8
+ ## Install
9
+
10
+ ```bash
11
+ npm install @xrayradar/react
12
+ ```
13
+
14
+ ## Quick start
15
+
16
+ ```tsx
17
+ import { init, captureException, ErrorBoundary } from "@xrayradar/react";
18
+
19
+ init({
20
+ dsn: "https://xrayradar.com/your_project_id",
21
+ authToken: "your-token",
22
+ // Optional: enable browser integrations (fetch/XHR/history/console)
23
+ // integrations: true,
24
+ });
25
+
26
+ function App() {
27
+ return (
28
+ <ErrorBoundary>
29
+ <YourApp />
30
+ </ErrorBoundary>
31
+ );
32
+ }
33
+ ```
34
+
35
+ ## Configuration
36
+
37
+ `init(options)` supports the same options as `@xrayradar/browser`:
38
+
39
+ - `dsn`, `authToken`, `debug`
40
+ - `environment`, `release`, `serverName`
41
+ - `sampleRate`, `maxBreadcrumbs`
42
+ - `beforeSend(event)` (sync or async)
43
+ - `transport`
44
+ - `integrations` (fetch/XHR/history/console)
45
+
46
+ Requires **React 17+**. For Next.js, use **@xrayradar/nextjs**. Full docs and Remix setup: [XrayRadar-JS-SDK](https://github.com/KingPegasus/XrayRadar-JS-SDK#readme).
package/dist/index.d.mts CHANGED
@@ -1,6 +1,6 @@
1
1
  import { Component, ReactNode, ErrorInfo } from 'react';
2
2
  import { BrowserClient } from '@xrayradar/browser';
3
- export { BrowserClient, addBreadcrumb, captureException, captureMessage, getClient, init, resetGlobal, setContext, setExtra, setTag, setUser } from '@xrayradar/browser';
3
+ export { BrowserClient, addBreadcrumb, captureException, captureMessage, getClient, init, parseDsn, resetGlobal, setContext, setExtra, setTag, setUser } from '@xrayradar/browser';
4
4
 
5
5
  interface ErrorBoundaryProps {
6
6
  children: ReactNode;
package/dist/index.d.ts CHANGED
@@ -1,6 +1,6 @@
1
1
  import { Component, ReactNode, ErrorInfo } from 'react';
2
2
  import { BrowserClient } from '@xrayradar/browser';
3
- export { BrowserClient, addBreadcrumb, captureException, captureMessage, getClient, init, resetGlobal, setContext, setExtra, setTag, setUser } from '@xrayradar/browser';
3
+ export { BrowserClient, addBreadcrumb, captureException, captureMessage, getClient, init, parseDsn, resetGlobal, setContext, setExtra, setTag, setUser } from '@xrayradar/browser';
4
4
 
5
5
  interface ErrorBoundaryProps {
6
6
  children: ReactNode;
package/dist/index.js CHANGED
@@ -27,6 +27,7 @@ __export(index_exports, {
27
27
  captureMessage: () => import_browser3.captureMessage,
28
28
  getClient: () => import_browser3.getClient,
29
29
  init: () => import_browser3.init,
30
+ parseDsn: () => import_browser3.parseDsn,
30
31
  resetGlobal: () => import_browser3.resetGlobal,
31
32
  setContext: () => import_browser3.setContext,
32
33
  setExtra: () => import_browser3.setExtra,
@@ -100,6 +101,7 @@ var import_browser3 = require("@xrayradar/browser");
100
101
  captureMessage,
101
102
  getClient,
102
103
  init,
104
+ parseDsn,
103
105
  resetGlobal,
104
106
  setContext,
105
107
  setExtra,
package/dist/index.mjs CHANGED
@@ -62,7 +62,8 @@ import {
62
62
  setUser,
63
63
  setTag,
64
64
  setExtra,
65
- setContext
65
+ setContext,
66
+ parseDsn
66
67
  } from "@xrayradar/browser";
67
68
  export {
68
69
  ErrorBoundary,
@@ -72,6 +73,7 @@ export {
72
73
  captureMessage,
73
74
  getClient2 as getClient,
74
75
  init,
76
+ parseDsn,
75
77
  resetGlobal,
76
78
  setContext,
77
79
  setExtra,
package/package.json CHANGED
@@ -1,7 +1,18 @@
1
1
  {
2
2
  "name": "@xrayradar/react",
3
- "version": "0.1.0",
4
- "description": "XrayRadar SDK for React ErrorBoundary, hooks, provider",
3
+ "version": "0.2.0",
4
+ "description": "XrayRadar SDK for React - ErrorBoundary, hooks, provider",
5
+ "keywords": [
6
+ "xrayradar",
7
+ "error-tracking",
8
+ "observability",
9
+ "monitoring",
10
+ "sdk",
11
+ "react",
12
+ "error-boundary",
13
+ "javascript",
14
+ "typescript"
15
+ ],
5
16
  "main": "./dist/index.js",
6
17
  "module": "./dist/index.mjs",
7
18
  "types": "./dist/index.d.ts",
@@ -12,13 +23,19 @@
12
23
  "require": "./dist/index.js"
13
24
  }
14
25
  },
15
- "files": ["dist"],
26
+ "files": [
27
+ "dist"
28
+ ],
16
29
  "scripts": {
17
30
  "build": "tsup src/index.tsx --format cjs,esm --dts --clean",
18
31
  "test": "vitest run --passWithNoTests",
32
+ "test:coverage": "vitest run --coverage --passWithNoTests",
19
33
  "lint": "eslint src",
20
34
  "clean": "rm -rf dist"
21
35
  },
36
+ "engines": {
37
+ "node": ">=20"
38
+ },
22
39
  "peerDependencies": {
23
40
  "react": ">=17.0.0"
24
41
  },
@@ -31,5 +48,9 @@
31
48
  "tsup": "^8.0.0",
32
49
  "typescript": "^5.3.3",
33
50
  "vitest": "^4.0.0"
51
+ },
52
+ "repository": {
53
+ "type": "git",
54
+ "url": "https://github.com/KingPegasus/XrayRadar-JS-SDK.git"
34
55
  }
35
56
  }