snapfail 0.0.7 → 0.0.9
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 +78 -0
- package/package.json +1 -1
package/README.md
ADDED
|
@@ -0,0 +1,78 @@
|
|
|
1
|
+
# snapfail
|
|
2
|
+
|
|
3
|
+
> **The official Command Line Interface (CLI) to automatically initialize and configure SnapFail error-tracking.**
|
|
4
|
+
|
|
5
|
+
[](https://www.npmjs.com/package/snapfail)
|
|
6
|
+
[](https://opensource.org/licenses/MIT)
|
|
7
|
+
|
|
8
|
+
**SnapFail CLI** is a terminal-based onboarding utility that automatically configures and integrates SnapFail error tracking and session replays inside your Vite and Astro codebases in seconds.
|
|
9
|
+
|
|
10
|
+
Visit the live telemetry dashboard at [app.snapfail.com](https://app.snapfail.com).
|
|
11
|
+
|
|
12
|
+
---
|
|
13
|
+
|
|
14
|
+
## Getting Started
|
|
15
|
+
|
|
16
|
+
You do not need to install the CLI permanently. You can run it on-demand using standard Node `npx`:
|
|
17
|
+
|
|
18
|
+
```bash
|
|
19
|
+
npx snapfail init
|
|
20
|
+
```
|
|
21
|
+
|
|
22
|
+
Or, if you prefer, install it globally on your system:
|
|
23
|
+
|
|
24
|
+
```bash
|
|
25
|
+
# npm
|
|
26
|
+
npm install -g snapfail
|
|
27
|
+
|
|
28
|
+
# pnpm
|
|
29
|
+
pnpm add -g snapfail
|
|
30
|
+
|
|
31
|
+
# Bun
|
|
32
|
+
bun add -g snapfail
|
|
33
|
+
```
|
|
34
|
+
|
|
35
|
+
Once installed globally, you can invoke the CLI with:
|
|
36
|
+
```bash
|
|
37
|
+
snapfail init
|
|
38
|
+
```
|
|
39
|
+
|
|
40
|
+
---
|
|
41
|
+
|
|
42
|
+
## Interactive Onboarding Flow
|
|
43
|
+
|
|
44
|
+
Running `snapfail init` initiates a guided terminal onboarding experience:
|
|
45
|
+
|
|
46
|
+
1. **Dashboard Authentication:** Automatically opens your default web browser to [app.snapfail.com/cli-auth](https://app.snapfail.com/cli-auth), securely performing a local CORS-approved handshake to authorize your CLI session.
|
|
47
|
+
2. **Project Selection:** Fetches your existing projects from the SnapFail dashboard, allowing you to select one or instantly create a new one right from the terminal.
|
|
48
|
+
3. **Session Replay Setup:** Prompts whether you want to enable **rrweb Session Replays** (enables full 60-second DOM playback video captures of browser crashes).
|
|
49
|
+
4. **Codebase Inspection:** Detects your project's build tool configuration:
|
|
50
|
+
* **Astro Project:** Locates `astro.config.mjs` / `astro.config.ts`, automatically installs `@snapfail/sdk` using your project's active package manager (`npm`, `pnpm`, `yarn`, or `bun`), and safely injects the `snapfail` integration.
|
|
51
|
+
* **Vite Project:** Locates `vite.config.js` / `vite.config.ts`, automatically installs `@snapfail/sdk`, and injects the `snapfail` Vite plugin.
|
|
52
|
+
* **Vanilla HTML:** Provides a ready-to-copy custom CDN `<script>` tag snippet pre-configured with your project's API Key and the new `sdk.js` loader.
|
|
53
|
+
|
|
54
|
+
---
|
|
55
|
+
|
|
56
|
+
## CLI Options
|
|
57
|
+
|
|
58
|
+
```bash
|
|
59
|
+
# Show help and commands list
|
|
60
|
+
npx snapfail --help
|
|
61
|
+
|
|
62
|
+
# Initialize integration in the current directory
|
|
63
|
+
npx snapfail init
|
|
64
|
+
```
|
|
65
|
+
|
|
66
|
+
---
|
|
67
|
+
|
|
68
|
+
## Advanced Detection Features
|
|
69
|
+
|
|
70
|
+
* 📦 **Dynamic Package Manager Detection:** The CLI automatically inspects lockfiles (`package-lock.json`, `pnpm-lock.yaml`, `bun.lock`, `yarn.lock`) to run the correct installation command natively in your project.
|
|
71
|
+
* 🔐 **Secure Handshake:** The CLI launches a temporary local secure server on port `4321` or random fallback, using full cross-origin headers to safely receive authorization tokens back from the dashboard browser.
|
|
72
|
+
* ⚡ **Node.js Native:** Executable binary runs natively in standard Node.js without requiring third-party runtime dependencies (like Bun or ts-node).
|
|
73
|
+
|
|
74
|
+
---
|
|
75
|
+
|
|
76
|
+
## License
|
|
77
|
+
|
|
78
|
+
MIT © [SnapFail Protocol](https://app.snapfail.com)
|