@absolutejs/beacon 0.3.13 → 0.3.14

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.
@@ -0,0 +1,107 @@
1
+ {
2
+ "contract": 2,
3
+ "identity": {
4
+ "accent": "#f97316",
5
+ "category": "observability",
6
+ "description": "Tiny browser observability SDK for uncaught errors, rejected promises, breadcrumbs, actionable UX/network signals, Core Web Vitals, trace correlation, and an optional session-replay id. Envelopes are validated by @absolutejs/errors/ingest; no credential belongs in browser settings.",
7
+ "docsUrl": "https://github.com/absolutejs/beacon",
8
+ "name": "@absolutejs/beacon",
9
+ "tagline": "Learn what visitors experience when a site goes wrong."
10
+ },
11
+ "settings": {
12
+ "type": "object",
13
+ "required": [
14
+ "project"
15
+ ],
16
+ "properties": {
17
+ "endpoint": {
18
+ "default": "/api/errors/ingest",
19
+ "description": "Same-origin or explicitly allowed error-ingest endpoint. Never put credentials in this URL.",
20
+ "title": "Error ingest endpoint",
21
+ "type": "string"
22
+ },
23
+ "environment": {
24
+ "description": "Deployment environment attached to each event.",
25
+ "examples": [
26
+ "production"
27
+ ],
28
+ "title": "Environment",
29
+ "type": "string"
30
+ },
31
+ "flushIntervalMs": {
32
+ "description": "How often buffered errors are flushed, in milliseconds. Default is 5000.",
33
+ "minimum": 250,
34
+ "title": "Flush interval",
35
+ "x-group": "advanced",
36
+ "type": "integer"
37
+ },
38
+ "maxBatch": {
39
+ "description": "Flush once this many events are buffered. Default is 30.",
40
+ "maximum": 100,
41
+ "minimum": 1,
42
+ "title": "Events per batch",
43
+ "x-group": "advanced",
44
+ "type": "integer"
45
+ },
46
+ "maxBreadcrumbs": {
47
+ "description": "Recent browser actions retained with an event. Default is 30.",
48
+ "maximum": 200,
49
+ "minimum": 0,
50
+ "title": "Breadcrumb limit",
51
+ "x-group": "advanced",
52
+ "type": "integer"
53
+ },
54
+ "project": {
55
+ "default": "web",
56
+ "description": "Project identifier accepted by the host ingest boundary. Managed hosts replace this with their tenant id.",
57
+ "title": "Project",
58
+ "type": "string"
59
+ },
60
+ "release": {
61
+ "description": "Immutable application release identifier.",
62
+ "title": "Release",
63
+ "type": "string"
64
+ },
65
+ "sampleRate": {
66
+ "default": 1,
67
+ "description": "Fraction of captured events retained, from 0 to 1.",
68
+ "maximum": 1,
69
+ "minimum": 0,
70
+ "title": "Event sample rate",
71
+ "type": "number"
72
+ },
73
+ "signals": {
74
+ "default": true,
75
+ "description": "Capture dead/rage clicks, failed or slow requests, 5xx responses, and console errors.",
76
+ "title": "Actionable browser signals",
77
+ "type": "boolean"
78
+ },
79
+ "vitals": {
80
+ "description": "Capture Core Web Vitals through the optional web-vitals peer.",
81
+ "title": "Core Web Vitals",
82
+ "type": "boolean"
83
+ }
84
+ }
85
+ },
86
+ "wiring": [
87
+ {
88
+ "description": "Initialize privacy-conscious browser error and experience capture. A host can add replay correlation through getReplayId without exposing it as configuration.",
89
+ "id": "default",
90
+ "client": {
91
+ "client": {
92
+ "code": "const beacon = initBeacon(${settings});",
93
+ "imports": [
94
+ {
95
+ "from": "@absolutejs/beacon",
96
+ "names": [
97
+ "initBeacon"
98
+ ]
99
+ }
100
+ ],
101
+ "placement": "client-entry"
102
+ }
103
+ },
104
+ "title": "Capture browser errors and experience signals"
105
+ }
106
+ ]
107
+ }
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "@absolutejs/beacon",
3
- "version": "0.3.13",
3
+ "version": "0.3.14",
4
4
  "description": "Tiny, zero-dependency browser SDK for the AbsoluteJS observability stack. Captures uncaught errors + unhandled rejections, breadcrumbs (console/click/fetch/history), batches, and POSTs an envelope to @absolutejs/errors/ingest via sendBeacon/keepalive. ~2-5KB gz, no Effect in the browser; end-to-end type-safe via the shared erased envelope contract.",
5
5
  "repository": {
6
6
  "type": "git",
@@ -21,7 +21,13 @@
21
21
  "types": "./dist/index.d.ts",
22
22
  "import": "./dist/index.js",
23
23
  "default": "./dist/index.js"
24
- }
24
+ },
25
+ "./manifest": {
26
+ "types": "./dist/manifest.d.ts",
27
+ "import": "./dist/manifest.js",
28
+ "default": "./dist/manifest.js"
29
+ },
30
+ "./manifest.json": "./dist/manifest.json"
25
31
  },
26
32
  "publishConfig": {
27
33
  "access": "public"
@@ -31,7 +37,7 @@
31
37
  "README.md"
32
38
  ],
33
39
  "scripts": {
34
- "build": "rm -rf dist && bun build src/index.ts --outdir dist --sourcemap --target=browser --external web-vitals && tsc --project tsconfig.build.json",
40
+ "build": "rm -rf dist && bun build src/index.ts src/manifest.ts --outdir dist --root ./src --sourcemap --target=browser --external web-vitals && tsc --project tsconfig.build.json && absolute-manifest emit",
35
41
  "test": "bun test",
36
42
  "typecheck": "tsc --noEmit",
37
43
  "format": "prettier --write \"./**/*.{ts,json,md}\"",
@@ -49,6 +55,13 @@
49
55
  "observability",
50
56
  "rum"
51
57
  ],
58
+ "absolutejs": {
59
+ "manifestContract": 2
60
+ },
61
+ "dependencies": {
62
+ "@absolutejs/manifest": "^0.4.0",
63
+ "@sinclair/typebox": "^0.34.0"
64
+ },
52
65
  "devDependencies": {
53
66
  "@absolutejs/errors": "^0.3.0",
54
67
  "@happy-dom/global-registrator": "^20.10.6",