@lunardinos/browser 0.2.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 +51 -0
- package/dist/recorder-core.js +4892 -0
- package/dist/src/persistence.d.ts +16 -0
- package/dist/src/persistence.d.ts.map +1 -0
- package/dist/src/persistence.js +62 -0
- package/dist/src/recorder-core.d.ts +72 -0
- package/dist/src/recorder-core.d.ts.map +1 -0
- package/dist/src/recorder-core.js +470 -0
- package/package.json +24 -0
package/README.md
ADDED
|
@@ -0,0 +1,51 @@
|
|
|
1
|
+
# @lunardinos/browser
|
|
2
|
+
|
|
3
|
+
Core session recording engine for [Lunar Dinos](https://lunardinos.com) — the session replay and product analytics platform for B2B SaaS.
|
|
4
|
+
|
|
5
|
+
This is a low-level package. Most users should install a framework-specific SDK instead:
|
|
6
|
+
|
|
7
|
+
- **TanStack Router** — [`@lunardinos/tanstack-router`](https://www.npmjs.com/package/@lunardinos/tanstack-router)
|
|
8
|
+
- **Next.js** — [`@lunardinos/nextjs`](https://www.npmjs.com/package/@lunardinos/nextjs)
|
|
9
|
+
|
|
10
|
+
## Installation
|
|
11
|
+
|
|
12
|
+
```bash
|
|
13
|
+
npm install @lunardinos/browser
|
|
14
|
+
```
|
|
15
|
+
|
|
16
|
+
## Usage
|
|
17
|
+
|
|
18
|
+
```ts
|
|
19
|
+
import { createLunarDinosRecorder } from "@lunardinos/browser"
|
|
20
|
+
|
|
21
|
+
const recorder = createLunarDinosRecorder({
|
|
22
|
+
apiKey: "your-api-key",
|
|
23
|
+
endpoint: "https://ingest.lunardinos.com", // default
|
|
24
|
+
})
|
|
25
|
+
|
|
26
|
+
// Start in cookieless mode if you need consent before setting cookies
|
|
27
|
+
// const recorder = createLunarDinosRecorder({ apiKey: "your-api-key", defaultPersistence: "cookieless" })
|
|
28
|
+
|
|
29
|
+
recorder.start()
|
|
30
|
+
|
|
31
|
+
// After cookie consent, switch to persistent sessions:
|
|
32
|
+
// recorder.setPersistence("cookie")
|
|
33
|
+
|
|
34
|
+
// Identify the current user/account
|
|
35
|
+
recorder.identify({
|
|
36
|
+
user: { id: "user-123", email: "jane@acme.com" },
|
|
37
|
+
account: { id: "acme", name: "Acme Inc" },
|
|
38
|
+
})
|
|
39
|
+
|
|
40
|
+
// Emit page navigation events
|
|
41
|
+
recorder.emitPageEvent({
|
|
42
|
+
url: window.location.href,
|
|
43
|
+
title: document.title,
|
|
44
|
+
routePattern: "/settings/:tab",
|
|
45
|
+
params: { tab: "billing" },
|
|
46
|
+
})
|
|
47
|
+
```
|
|
48
|
+
|
|
49
|
+
## Learn more
|
|
50
|
+
|
|
51
|
+
Visit [lunardinos.com](https://lunardinos.com) to get started.
|