@merittdev/horus-lens 0.0.2 → 0.0.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 +51 -22
- package/dist/browser.cjs +1 -1
- package/dist/browser.cjs.map +1 -1
- package/dist/browser.js +2 -2
- package/dist/{chunk-DU7HNRF4.js → chunk-CTBY5XIN.js} +2 -2
- package/dist/{chunk-S6S3ZZQA.js → chunk-XRONR4GR.js} +2 -2
- package/dist/{chunk-S6S3ZZQA.js.map → chunk-XRONR4GR.js.map} +1 -1
- package/dist/dashboard.cjs +784 -434
- package/dist/dashboard.cjs.map +1 -1
- package/dist/dashboard.css +224 -1
- package/dist/dashboard.d.cts +85 -1
- package/dist/dashboard.d.ts +85 -1
- package/dist/dashboard.js +648 -301
- package/dist/dashboard.js.map +1 -1
- package/dist/index.cjs +1 -1
- package/dist/index.cjs.map +1 -1
- package/dist/index.js +1 -1
- package/dist/lens.min.js +1 -1
- package/dist/lens.min.js.map +1 -1
- package/dist/react.cjs +6 -3
- package/dist/react.cjs.map +1 -1
- package/dist/react.d.cts +18 -6
- package/dist/react.d.ts +18 -6
- package/dist/react.js +6 -4
- package/dist/react.js.map +1 -1
- package/dist/server.cjs +109 -0
- package/dist/server.cjs.map +1 -0
- package/dist/server.d.cts +59 -0
- package/dist/server.d.ts +59 -0
- package/dist/server.js +82 -0
- package/dist/server.js.map +1 -0
- package/package.json +9 -4
- /package/dist/{chunk-DU7HNRF4.js.map → chunk-CTBY5XIN.js.map} +0 -0
package/README.md
CHANGED
|
@@ -30,20 +30,19 @@ Or with a script tag (any website — no build step):
|
|
|
30
30
|
### React
|
|
31
31
|
|
|
32
32
|
```tsx
|
|
33
|
-
import {
|
|
33
|
+
import { Lens } from '@merittdev/horus-lens/react';
|
|
34
34
|
|
|
35
|
-
|
|
35
|
+
// anywhere in your root layout — renders nothing, mounts the overlay
|
|
36
|
+
<Lens
|
|
36
37
|
accessId="lai_your_access_id"
|
|
37
|
-
endpoint="https://api-lens.meritt.app"
|
|
38
38
|
app={{ release: APP_VERSION, gitSha: COMMIT_SHA, user: { id: user.id } }}
|
|
39
|
-
|
|
40
|
-
<App />
|
|
41
|
-
</LensProvider>
|
|
39
|
+
/>
|
|
42
40
|
```
|
|
43
41
|
|
|
44
42
|
The React entry additionally captures the React component tree of whatever element
|
|
45
43
|
the reporter picks. Use `enabled={isPreviewEnv}` to force the overlay on (e.g. every
|
|
46
|
-
preview deployment)
|
|
44
|
+
preview deployment). Wrap children with `<Lens>` only when a descendant needs the
|
|
45
|
+
`useLens()` hook for programmatic control.
|
|
47
46
|
|
|
48
47
|
### Script tag
|
|
49
48
|
|
|
@@ -55,26 +54,51 @@ Lens('app', { release: 'v2.14.3', featureFlags: { newCheckout: true } });
|
|
|
55
54
|
Lens('open'); // open the report panel programmatically
|
|
56
55
|
```
|
|
57
56
|
|
|
58
|
-
### Dashboard
|
|
57
|
+
### Dashboard (your own admin, no hosted dashboard)
|
|
58
|
+
|
|
59
|
+
One component, one config. On an access-controlled page (your admin auth is the
|
|
60
|
+
gate), read the credentials server-side and hand them to the component:
|
|
59
61
|
|
|
60
62
|
```tsx
|
|
61
|
-
|
|
62
|
-
|
|
63
|
-
|
|
64
|
-
|
|
63
|
+
// page.tsx — server component, env stays on the server
|
|
64
|
+
import LensPageClient from './LensPageClient';
|
|
65
|
+
|
|
66
|
+
export default function Page() {
|
|
67
|
+
return <LensPageClient config={{ projects: JSON.parse(process.env.LENS_PROJECTS ?? '[]') }} />;
|
|
68
|
+
}
|
|
69
|
+
|
|
70
|
+
// LensPageClient.tsx — client component
|
|
71
|
+
'use client'
|
|
72
|
+
import { LensProvider, LensAdmin, type LensAdminConfig } from '@merittdev/horus-lens/dashboard';
|
|
65
73
|
import '@merittdev/horus-lens/dist/dashboard.css';
|
|
66
74
|
|
|
67
|
-
|
|
68
|
-
|
|
69
|
-
|
|
70
|
-
|
|
75
|
+
export default function LensPageClient({ config }: { config: LensAdminConfig }) {
|
|
76
|
+
return (
|
|
77
|
+
<LensProvider config={config}>
|
|
78
|
+
<LensAdmin />
|
|
79
|
+
</LensProvider>
|
|
80
|
+
);
|
|
81
|
+
}
|
|
71
82
|
```
|
|
72
83
|
|
|
73
|
-
|
|
74
|
-
|
|
75
|
-
|
|
76
|
-
|
|
77
|
-
|
|
84
|
+
```bash
|
|
85
|
+
LENS_PROJECTS=[{"name":"front","accessId":"lai_…","secretKey":"las_…"}]
|
|
86
|
+
```
|
|
87
|
+
|
|
88
|
+
No projects yet? Pass `config={{ projects: [], adminToken: process.env.LENS_ADMIN_TOKEN }}`
|
|
89
|
+
and the built-in wizard mints the first project and hands you that env line.
|
|
90
|
+
|
|
91
|
+
You get the full surface: reports (search + pagination + shareable
|
|
92
|
+
`?report=` deep links), replay player, integrations (OAuth to
|
|
93
|
+
Linear/GitHub/Jira with provider-fed dropdowns), project switcher, onboarding.
|
|
94
|
+
Light-first monochrome; dark mode via `theme="dark"`, `.dark`, or
|
|
95
|
+
`[data-theme="dark"]`.
|
|
96
|
+
|
|
97
|
+
Prefer keys to never reach the browser at all (shared machines, stricter
|
|
98
|
+
compliance)? Use proxy mode instead: mount the package's server handlers and
|
|
99
|
+
drop the `config` prop — see `@merittdev/horus-lens/server`
|
|
100
|
+
(`createLensProxy` + `createLensProjectsRoute`). Piecemeal components
|
|
101
|
+
(`ReportsTable`, `ReportDetail`, …) remain exported for custom layouts.
|
|
78
102
|
|
|
79
103
|
## When does the overlay appear?
|
|
80
104
|
|
|
@@ -87,7 +111,12 @@ import on the same check.
|
|
|
87
111
|
|
|
88
112
|
- `lai_…` **access id** — public by design (like a GA measurement id). Enforced by a
|
|
89
113
|
per-project origin allowlist and rate limits on the API.
|
|
90
|
-
- `las_…` **secret key** — server-side
|
|
114
|
+
- `las_…` **secret key** — full project access. Read it server-side and hand it only
|
|
115
|
+
to access-controlled surfaces (your admin page via `<LensProvider config>`), CI, or
|
|
116
|
+
the management API — never a public page.
|
|
117
|
+
|
|
118
|
+
The SDK talks to the hosted Lens API out of the box — no endpoint configuration.
|
|
119
|
+
Self-hosting? Pass `endpoint` (React/script `init` config) to point anywhere else.
|
|
91
120
|
|
|
92
121
|
## Self-hosting
|
|
93
122
|
|
package/dist/browser.cjs
CHANGED
|
@@ -29086,7 +29086,7 @@ var ConnectIntegrationResponseSchema = external_exports.object({
|
|
|
29086
29086
|
// ../core/dist/index.js
|
|
29087
29087
|
var SDK_NAME = "@merittdev/horus-lens";
|
|
29088
29088
|
var SDK_VERSION = "0.0.1";
|
|
29089
|
-
var DEFAULT_ENDPOINT = "
|
|
29089
|
+
var DEFAULT_ENDPOINT = "https://api-lens.meritt.app";
|
|
29090
29090
|
var DEFAULT_REPLAY_WINDOW_MS = 15e3;
|
|
29091
29091
|
var DEFAULT_MAX_CONSOLE_ENTRIES = 200;
|
|
29092
29092
|
var DEFAULT_MAX_NETWORK_ENTRIES = 100;
|