@xrayradar/browser 0.1.0 → 0.1.1

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.
Files changed (2) hide show
  1. package/README.md +25 -0
  2. package/package.json +8 -2
package/README.md ADDED
@@ -0,0 +1,25 @@
1
+ # @xrayradar/browser
2
+
3
+ XrayRadar SDK for the **browser** – capture errors and messages and send them to your [XrayRadar](https://xrayradar.com) server. Uses `fetch` and automatically hooks into `window.onerror` and `unhandledrejection`.
4
+
5
+ ## Install
6
+
7
+ ```bash
8
+ npm install @xrayradar/browser
9
+ ```
10
+
11
+ ## Quick start
12
+
13
+ ```ts
14
+ import { init, captureException, captureMessage } from "@xrayradar/browser";
15
+
16
+ init({
17
+ dsn: "https://xrayradar.com/your_project_id",
18
+ authToken: "your-token",
19
+ });
20
+
21
+ captureException(new Error("Something broke"));
22
+ captureMessage("Something happened");
23
+ ```
24
+
25
+ For React (ErrorBoundary, Provider, hooks), use **@xrayradar/react**. Full docs: [XrayRadar-JS-SDK](https://github.com/KingPegasus/XrayRadar-JS-SDK#readme).
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "@xrayradar/browser",
3
- "version": "0.1.0",
3
+ "version": "0.1.1",
4
4
  "description": "XrayRadar SDK for browser",
5
5
  "main": "./dist/index.js",
6
6
  "module": "./dist/index.mjs",
@@ -12,7 +12,9 @@
12
12
  "require": "./dist/index.js"
13
13
  }
14
14
  },
15
- "files": ["dist"],
15
+ "files": [
16
+ "dist"
17
+ ],
16
18
  "scripts": {
17
19
  "build": "tsup src/index.ts --format cjs,esm --dts --clean",
18
20
  "test": "vitest run --passWithNoTests",
@@ -26,5 +28,9 @@
26
28
  "tsup": "^8.0.0",
27
29
  "typescript": "^5.3.3",
28
30
  "vitest": "^4.0.0"
31
+ },
32
+ "repository": {
33
+ "type": "git",
34
+ "url": "https://github.com/KingPegasus/XrayRadar-JS-SDK.git"
29
35
  }
30
36
  }