@merittdev/horus-lens 0.0.1 → 0.0.2

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.
Files changed (2) hide show
  1. package/README.md +100 -0
  2. package/package.json +25 -4
package/README.md ADDED
@@ -0,0 +1,100 @@
1
+ # Lens — `@merittdev/horus-lens`
2
+
3
+ Context-rich issue capture for web apps, part of the [Horus](https://horus.sh) ecosystem.
4
+
5
+ A teammate visits your app with `?lens=true`, an overlay appears, they describe the
6
+ issue (pick an element, mark an area, or record their steps), press Submit — and Lens
7
+ ships a report with a session replay, screenshot, console + network buffers, DOM
8
+ snapshot, environment, release/git SHA, and user context. Reports become issues in
9
+ **Linear, GitHub, or Jira** automatically, with the screenshot embedded and a
10
+ shareable replay link.
11
+
12
+ ## Install
13
+
14
+ ```bash
15
+ npm install @merittdev/horus-lens
16
+ ```
17
+
18
+ Or with a script tag (any website — no build step):
19
+
20
+ ```html
21
+ <script>
22
+ window.Lens=window.Lens||function(){(Lens.q=Lens.q||[]).push(arguments)};
23
+ Lens('init', 'lai_your_access_id');
24
+ </script>
25
+ <script async src="https://cdn.jsdelivr.net/npm/@merittdev/horus-lens/dist/lens.min.js"></script>
26
+ ```
27
+
28
+ ## Quickstart
29
+
30
+ ### React
31
+
32
+ ```tsx
33
+ import { LensProvider } from '@merittdev/horus-lens/react';
34
+
35
+ <LensProvider
36
+ accessId="lai_your_access_id"
37
+ endpoint="https://api-lens.meritt.app"
38
+ app={{ release: APP_VERSION, gitSha: COMMIT_SHA, user: { id: user.id } }}
39
+ >
40
+ <App />
41
+ </LensProvider>
42
+ ```
43
+
44
+ The React entry additionally captures the React component tree of whatever element
45
+ the reporter picks. Use `enabled={isPreviewEnv}` to force the overlay on (e.g. every
46
+ preview deployment), and `useLens()` for programmatic control.
47
+
48
+ ### Script tag
49
+
50
+ Context can be pushed before the bundle even loads:
51
+
52
+ ```js
53
+ Lens('identify', { id: 'u_42', email: 'sarah@acme.com' });
54
+ Lens('app', { release: 'v2.14.3', featureFlags: { newCheckout: true } });
55
+ Lens('open'); // open the report panel programmatically
56
+ ```
57
+
58
+ ### Dashboard components (your own admin, no hosted dashboard)
59
+
60
+ ```tsx
61
+ import {
62
+ createLensApi, LensDashboardProvider,
63
+ ReportsTable, ReportDetail, IntegrationSettings, OnboardingWizard,
64
+ } from '@merittdev/horus-lens/dashboard';
65
+ import '@merittdev/horus-lens/dist/dashboard.css';
66
+
67
+ const api = createLensApi({
68
+ baseUrl: '/api/lens', // your server-side proxy
69
+ getToken: () => '', // credentials attach server-side — never in the browser
70
+ });
71
+ ```
72
+
73
+ Ships a reports table (search + pagination), tabbed report detail with a replay
74
+ player, integration management (OAuth to Linear/GitHub/Jira, single active
75
+ destination), and a self-serve onboarding wizard. Light-first monochrome design that
76
+ drops into any admin; dark mode via `.dark`, `[data-theme="dark"]`, or
77
+ `<LensDashboardProvider theme="dark">`.
78
+
79
+ ## When does the overlay appear?
80
+
81
+ Never, for normal visitors. The SDK stays dormant until a page is opened with
82
+ **`?lens=true`** — then the pill appears and persists for the session
83
+ (`?lens=false` turns it off). Zero bundle cost for real users when you gate the
84
+ import on the same check.
85
+
86
+ ## Keys
87
+
88
+ - `lai_…` **access id** — public by design (like a GA measurement id). Enforced by a
89
+ per-project origin allowlist and rate limits on the API.
90
+ - `las_…` **secret key** — server-side only: management API, dashboard proxy, CI.
91
+
92
+ ## Self-hosting
93
+
94
+ The Lens API is a single Docker image (Fastify + Postgres + your own S3 bucket —
95
+ assets upload browser→S3 via presigned URLs and never transit the API). See the
96
+ [repository](https://github.com/Meritt-dev/horus-lens) for deployment docs.
97
+
98
+ ## License
99
+
100
+ MIT © Meritt Dev
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "@merittdev/horus-lens",
3
- "version": "0.0.1",
3
+ "version": "0.0.2",
4
4
  "description": "Lens — context-rich issue capture for web apps: overlay, replay, and drop-in dashboard components",
5
5
  "license": "MIT",
6
6
  "type": "module",
@@ -51,15 +51,36 @@
51
51
  "devDependencies": {
52
52
  "tsup": "^8.4.0",
53
53
  "typescript": "^5.7.3",
54
- "@horus-lens/core": "0.0.1",
55
54
  "@horus-lens/browser": "0.0.1",
56
- "@horus-lens/react": "0.0.1",
57
55
  "@horus-lens/dashboard": "0.0.1",
58
- "@horus-lens/shared": "0.0.1"
56
+ "@horus-lens/react": "0.0.1",
57
+ "@horus-lens/shared": "0.0.1",
58
+ "@horus-lens/core": "0.0.1"
59
59
  },
60
60
  "publishConfig": {
61
61
  "access": "public"
62
62
  },
63
+ "keywords": [
64
+ "bug-reporting",
65
+ "session-replay",
66
+ "rrweb",
67
+ "feedback",
68
+ "issue-tracking",
69
+ "linear",
70
+ "jira",
71
+ "github",
72
+ "screenshot",
73
+ "developer-tools"
74
+ ],
75
+ "repository": {
76
+ "type": "git",
77
+ "url": "git+https://github.com/Meritt-dev/horus-lens.git",
78
+ "directory": "packages/lens"
79
+ },
80
+ "homepage": "https://github.com/Meritt-dev/horus-lens#readme",
81
+ "bugs": {
82
+ "url": "https://github.com/Meritt-dev/horus-lens/issues"
83
+ },
63
84
  "scripts": {
64
85
  "build": "tsup && node scripts/copy-assets.mjs",
65
86
  "typecheck": "tsc --noEmit",