crumbtrail-core 0.2.1 → 0.2.3
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 +84 -5
- package/package.json +13 -4
package/README.md
CHANGED
|
@@ -1,12 +1,91 @@
|
|
|
1
1
|
# crumbtrail-core
|
|
2
2
|
|
|
3
|
-
|
|
3
|
+
The capture engine behind [Crumbtrail](https://crumbtrail.dev). It records what
|
|
4
|
+
actually happened around a bug — the console, the network calls, the DOM
|
|
5
|
+
interactions, the state — and hands it over as evidence a coding agent can act on,
|
|
6
|
+
instead of a screenshot and a vague repro.
|
|
4
7
|
|
|
5
|
-
|
|
6
|
-
|
|
8
|
+
Framework-agnostic, with **no dependencies**.
|
|
9
|
+
|
|
10
|
+
## Install
|
|
7
11
|
|
|
8
12
|
```bash
|
|
9
|
-
npm
|
|
13
|
+
npm install crumbtrail-core
|
|
14
|
+
```
|
|
15
|
+
|
|
16
|
+
Or let the wizard install and wire it for you:
|
|
17
|
+
|
|
18
|
+
```bash
|
|
19
|
+
npx crumbtrail
|
|
20
|
+
```
|
|
21
|
+
|
|
22
|
+
## Setup
|
|
23
|
+
|
|
24
|
+
Call `Crumbtrail.init()` once, at your app's entry point:
|
|
25
|
+
|
|
26
|
+
```ts
|
|
27
|
+
import { Crumbtrail, PRESET_PASSIVE } from "crumbtrail-core";
|
|
28
|
+
|
|
29
|
+
Crumbtrail.init({
|
|
30
|
+
...PRESET_PASSIVE,
|
|
31
|
+
httpEndpoint: "https://api.crumbtrail.dev",
|
|
32
|
+
httpAuthToken: process.env.CRUMBTRAIL_KEY,
|
|
33
|
+
});
|
|
10
34
|
```
|
|
11
35
|
|
|
12
|
-
|
|
36
|
+
That's the whole integration — capture runs in the background from there.
|
|
37
|
+
|
|
38
|
+
### Presets
|
|
39
|
+
|
|
40
|
+
| Preset | Behaviour |
|
|
41
|
+
| --- | --- |
|
|
42
|
+
| `PRESET_PASSIVE` | Capture continuously and auto-flag on errors and signals. The default. |
|
|
43
|
+
| `PRESET_LIGHT` | Leaner capture, less overhead. |
|
|
44
|
+
| `PRESET_FULL` | Everything, for a heavy debugging session. |
|
|
45
|
+
|
|
46
|
+
### Flagging a bug yourself
|
|
47
|
+
|
|
48
|
+
`init()` returns the instance, so you can mark moments explicitly:
|
|
49
|
+
|
|
50
|
+
```ts
|
|
51
|
+
const crumbtrail = Crumbtrail.init({ ...PRESET_PASSIVE, httpEndpoint });
|
|
52
|
+
|
|
53
|
+
crumbtrail.mark("checkout: submitted");
|
|
54
|
+
|
|
55
|
+
await crumbtrail.flagBug({
|
|
56
|
+
note: "Payment failed with no error toast",
|
|
57
|
+
tags: ["checkout"],
|
|
58
|
+
});
|
|
59
|
+
```
|
|
60
|
+
|
|
61
|
+
Also on the instance: `addEvent`, `registerStateProvider`, `setEnv`,
|
|
62
|
+
`createRequestHeaders`, `pause`, `resume`, `stop`, `getSessionId`.
|
|
63
|
+
|
|
64
|
+
## Redaction is on by default
|
|
65
|
+
|
|
66
|
+
Crumbtrail is meant to be pointed at real traffic, so scrubbing isn't opt-in.
|
|
67
|
+
Tokens, cookies, storage values and sensitive input values are redacted before an
|
|
68
|
+
event ever leaves the browser. See `BROWSER_REDACTION_POLICY` and the `redact*`
|
|
69
|
+
helpers if you want to inspect or tighten the policy.
|
|
70
|
+
|
|
71
|
+
## Related packages
|
|
72
|
+
|
|
73
|
+
| Package | Use it for |
|
|
74
|
+
| --- | --- |
|
|
75
|
+
| [`crumbtrail`](https://www.npmjs.com/package/crumbtrail) | The `npx crumbtrail` setup wizard |
|
|
76
|
+
| [`crumbtrail-node`](https://www.npmjs.com/package/crumbtrail-node) | Self-hosted server, Express middleware, MCP evidence tools |
|
|
77
|
+
| [`crumbtrail-react`](https://www.npmjs.com/package/crumbtrail-react) | React error boundary and state-capture hook |
|
|
78
|
+
| [`crumbtrail-react-native`](https://www.npmjs.com/package/crumbtrail-react-native) | React Native bindings |
|
|
79
|
+
| [`crumbtrail-tauri`](https://www.npmjs.com/package/crumbtrail-tauri) | Tauri desktop bindings |
|
|
80
|
+
|
|
81
|
+
## Links
|
|
82
|
+
|
|
83
|
+
- **Website** — https://crumbtrail.dev
|
|
84
|
+
- **Docs** — https://crumbtrail.dev/docs
|
|
85
|
+
- **How it works** — https://crumbtrail.dev/how-it-works
|
|
86
|
+
- **Source** — https://github.com/crumbtrail-dev/crumbtrail-js
|
|
87
|
+
- **Issues** — https://github.com/crumbtrail-dev/crumbtrail-js/issues
|
|
88
|
+
|
|
89
|
+
## License
|
|
90
|
+
|
|
91
|
+
MIT
|
package/package.json
CHANGED
|
@@ -1,7 +1,7 @@
|
|
|
1
1
|
{
|
|
2
2
|
"name": "crumbtrail-core",
|
|
3
|
-
"version": "0.2.
|
|
4
|
-
"description": "
|
|
3
|
+
"version": "0.2.3",
|
|
4
|
+
"description": "Capture the console, network, DOM and state around a bug and hand it to a coding agent as evidence. Zero-dependency browser SDK. See https://crumbtrail.dev",
|
|
5
5
|
"license": "MIT",
|
|
6
6
|
"repository": {
|
|
7
7
|
"type": "git",
|
|
@@ -11,9 +11,18 @@
|
|
|
11
11
|
"keywords": [
|
|
12
12
|
"crumbtrail",
|
|
13
13
|
"debugging",
|
|
14
|
+
"bug-reporting",
|
|
15
|
+
"ai-agents",
|
|
16
|
+
"coding-agent",
|
|
14
17
|
"session-replay",
|
|
15
18
|
"observability",
|
|
16
|
-
"
|
|
19
|
+
"developer-tools",
|
|
20
|
+
"browser-sdk",
|
|
21
|
+
"error-tracking",
|
|
22
|
+
"javascript",
|
|
23
|
+
"typescript",
|
|
24
|
+
"redaction",
|
|
25
|
+
"telemetry"
|
|
17
26
|
],
|
|
18
27
|
"type": "module",
|
|
19
28
|
"main": "./dist/index.cjs",
|
|
@@ -33,7 +42,7 @@
|
|
|
33
42
|
"publishConfig": {
|
|
34
43
|
"access": "public"
|
|
35
44
|
},
|
|
36
|
-
"homepage": "https://
|
|
45
|
+
"homepage": "https://crumbtrail.dev",
|
|
37
46
|
"bugs": {
|
|
38
47
|
"url": "https://github.com/crumbtrail-dev/crumbtrail-js/issues"
|
|
39
48
|
},
|