tracebck-sdk 0.1.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 +72 -0
- package/dist/index.cjs +71 -0
- package/dist/index.iife.js +71 -0
- package/dist/index.js +71 -0
- package/package.json +51 -0
package/README.md
ADDED
|
@@ -0,0 +1,72 @@
|
|
|
1
|
+
# tracebck-sdk
|
|
2
|
+
|
|
3
|
+
Lightweight session recording SDK based on [rrweb](https://github.com/rrweb-io/rrweb).
|
|
4
|
+
|
|
5
|
+
## Installation
|
|
6
|
+
|
|
7
|
+
```bash
|
|
8
|
+
npm install tracebck-sdk
|
|
9
|
+
```
|
|
10
|
+
|
|
11
|
+
Or via CDN:
|
|
12
|
+
|
|
13
|
+
```html
|
|
14
|
+
<script src="https://unpkg.com/tracebck-sdk/dist/index.iife.js"></script>
|
|
15
|
+
```
|
|
16
|
+
|
|
17
|
+
## Usage
|
|
18
|
+
|
|
19
|
+
### ES Modules
|
|
20
|
+
|
|
21
|
+
```javascript
|
|
22
|
+
import { init, startSession, stopSession } from 'tracebck-sdk';
|
|
23
|
+
|
|
24
|
+
// Initialize with your API key
|
|
25
|
+
init({
|
|
26
|
+
apiKey: 'your-api-key',
|
|
27
|
+
// endpoint: 'https://your-api.com/v1', // optional, uses default
|
|
28
|
+
debug: false // optional
|
|
29
|
+
});
|
|
30
|
+
|
|
31
|
+
// Start recording
|
|
32
|
+
startSession({
|
|
33
|
+
identifier: {
|
|
34
|
+
type: 'userId', // or 'email', 'anonymous', etc.
|
|
35
|
+
value: 'user-123'
|
|
36
|
+
},
|
|
37
|
+
metadata: {
|
|
38
|
+
plan: 'premium' // optional custom metadata
|
|
39
|
+
}
|
|
40
|
+
});
|
|
41
|
+
|
|
42
|
+
// Stop recording (call on logout or when done)
|
|
43
|
+
stopSession();
|
|
44
|
+
```
|
|
45
|
+
|
|
46
|
+
### Script Tag
|
|
47
|
+
|
|
48
|
+
```html
|
|
49
|
+
<script src="https://unpkg.com/tracebck-sdk/dist/index.iife.js"></script>
|
|
50
|
+
<script>
|
|
51
|
+
Tracebck.init({
|
|
52
|
+
apiKey: 'your-api-key'
|
|
53
|
+
});
|
|
54
|
+
|
|
55
|
+
Tracebck.startSession({
|
|
56
|
+
identifier: { type: 'userId', value: 'user-123' }
|
|
57
|
+
});
|
|
58
|
+
</script>
|
|
59
|
+
```
|
|
60
|
+
|
|
61
|
+
## Configuration Options
|
|
62
|
+
|
|
63
|
+
| Option | Type | Default | Description |
|
|
64
|
+
|--------|------|---------|-------------|
|
|
65
|
+
| `apiKey` | string | required | Your API key |
|
|
66
|
+
| `maskAllInputs` | boolean | `false` | Mask all input values for privacy |
|
|
67
|
+
| `options` | object | `{}` | Additional rrweb options |
|
|
68
|
+
|
|
69
|
+
|
|
70
|
+
## License
|
|
71
|
+
|
|
72
|
+
MIT
|