@merittdev/horus-lens 0.0.2 → 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 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 { LensProvider } from '@merittdev/horus-lens/react';
33
+ import { Lens } from '@merittdev/horus-lens/react';
34
34
 
35
- <LensProvider
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), and `useLens()` for programmatic control.
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,14 @@ Lens('app', { release: 'v2.14.3', featureFlags: { newCheckout: true } });
55
54
  Lens('open'); // open the report panel programmatically
56
55
  ```
57
56
 
58
- ### Dashboard components (your own admin, no hosted dashboard)
57
+ ### Reviewing reports
59
58
 
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">`.
59
+ This package is the **capture SDK only** — there's no dashboard to install. Once
60
+ a report is submitted, review it in the **horus-cloud** workspace under its
61
+ "Lens" section: reports (search + pagination + shareable deep links), the replay
62
+ player, and issue-tracker integrations (OAuth to Linear/GitHub/Jira) all live
63
+ there. Your `las_…` secret stays server-side in horus-cloud and never reaches the
64
+ browser.
78
65
 
79
66
  ## When does the overlay appear?
80
67
 
@@ -87,7 +74,11 @@ import on the same check.
87
74
 
88
75
  - `lai_…` **access id** — public by design (like a GA measurement id). Enforced by a
89
76
  per-project origin allowlist and rate limits on the API.
90
- - `las_…` **secret key** — server-side only: management API, dashboard proxy, CI.
77
+ - `las_…` **secret key** — full project access. Held server-side by horus-cloud
78
+ (the "Lens" workspace section), CI, or the management API — never a public page.
79
+
80
+ The SDK talks to the hosted Lens API out of the box — no endpoint configuration.
81
+ Self-hosting? Pass `endpoint` (React/script `init` config) to point anywhere else.
91
82
 
92
83
  ## Self-hosting
93
84
 
package/dist/browser.cjs CHANGED
@@ -29000,93 +29000,11 @@ var ApiErrorSchema = external_exports.object({
29000
29000
  error: external_exports.string(),
29001
29001
  message: external_exports.string()
29002
29002
  });
29003
- var IntegrationProviderSchema = external_exports.enum(["github", "jira", "linear"]);
29004
- var IntegrationStatusSchema = external_exports.enum(["disconnected", "pending", "connected"]);
29005
- var IntegrationConfigSchema = external_exports.object({
29006
- /** github: "owner/repo" issues target. */
29007
- repo: external_exports.string().optional(),
29008
- /** linear: team key (e.g. "ENG"); defaults to the first team when unset. */
29009
- teamKey: external_exports.string().optional(),
29010
- /** jira: project key (e.g. "BUG"). Required before issues can be created. */
29011
- projectKey: external_exports.string().optional(),
29012
- /** jira: issue type name. Defaults to "Bug", falling back to "Task". */
29013
- issueType: external_exports.string().optional()
29014
- });
29015
- var IntegrationSchema = external_exports.object({
29016
- provider: IntegrationProviderSchema,
29017
- status: IntegrationStatusSchema,
29018
- account: external_exports.string().nullable().default(null),
29019
- active: external_exports.boolean().default(false),
29020
- config: IntegrationConfigSchema.default({})
29021
- });
29022
- var S3ConfigInputSchema = external_exports.object({
29023
- bucket: external_exports.string().min(1),
29024
- region: external_exports.string().min(1),
29025
- endpoint: external_exports.string().url().optional(),
29026
- accessKeyId: external_exports.string().min(1),
29027
- secretAccessKey: external_exports.string().min(1),
29028
- forcePathStyle: external_exports.boolean().optional()
29029
- });
29030
- var S3ConfigPublicSchema = external_exports.object({
29031
- bucket: external_exports.string(),
29032
- region: external_exports.string(),
29033
- endpoint: external_exports.string().optional(),
29034
- forcePathStyle: external_exports.boolean().optional(),
29035
- /** e.g. "AKIA…F3D2" */
29036
- accessKeyIdMasked: external_exports.string()
29037
- });
29038
- var ProjectSchema = external_exports.object({
29039
- id: external_exports.string(),
29040
- name: external_exports.string(),
29041
- accessId: external_exports.string(),
29042
- allowedOrigins: external_exports.array(external_exports.string()),
29043
- /** Active issue destination; null until onboarding picks one. */
29044
- destination: IntegrationProviderSchema.nullable(),
29045
- /**
29046
- * The customer dashboard page hosting the Lens components (e.g.
29047
- * "https://admin.acme.com/lens"). Auto-created issues deep-link reports as
29048
- * `<dashboardUrl>?report=<id>` when set.
29049
- */
29050
- dashboardUrl: external_exports.string().nullable().default(null),
29051
- s3: S3ConfigPublicSchema.nullable(),
29052
- onboardedAt: external_exports.string().nullable(),
29053
- createdAt: external_exports.string()
29054
- });
29055
- var CreateProjectRequestSchema = external_exports.object({
29056
- name: external_exports.string().min(1).max(120),
29057
- allowedOrigins: external_exports.array(external_exports.string()).default([])
29058
- });
29059
- var CreateProjectResponseSchema = external_exports.object({
29060
- project: ProjectSchema,
29061
- accessId: external_exports.string(),
29062
- accessSecret: external_exports.string()
29063
- });
29064
- var UpdateProjectRequestSchema = external_exports.object({
29065
- name: external_exports.string().min(1).max(120).optional(),
29066
- allowedOrigins: external_exports.array(external_exports.string()).optional(),
29067
- onboarded: external_exports.boolean().optional(),
29068
- dashboardUrl: external_exports.string().url().nullable().optional()
29069
- });
29070
- var ListIntegrationsResponseSchema = external_exports.object({
29071
- integrations: external_exports.array(IntegrationSchema)
29072
- });
29073
- var ConnectIntegrationRequestSchema = external_exports.object({
29074
- /**
29075
- * Where the provider's OAuth dance should land the user afterwards —
29076
- * the calling dashboard's own URL. Packed into the signed `state` so the
29077
- * fixed API callback can redirect back to any consumer dashboard.
29078
- */
29079
- returnUrl: external_exports.string().url().optional()
29080
- });
29081
- var ConnectIntegrationResponseSchema = external_exports.object({
29082
- authorizeUrl: external_exports.string(),
29083
- provider: IntegrationProviderSchema
29084
- });
29085
29003
 
29086
29004
  // ../core/dist/index.js
29087
29005
  var SDK_NAME = "@merittdev/horus-lens";
29088
29006
  var SDK_VERSION = "0.0.1";
29089
- var DEFAULT_ENDPOINT = "http://localhost:5625";
29007
+ var DEFAULT_ENDPOINT = "https://api.horus.sh";
29090
29008
  var DEFAULT_REPLAY_WINDOW_MS = 15e3;
29091
29009
  var DEFAULT_MAX_CONSOLE_ENTRIES = 200;
29092
29010
  var DEFAULT_MAX_NETWORK_ENTRIES = 100;