# Claude Code setup Source: https://docs.lucenthq.com/ai-tools/claude-code Configure Claude Code for your documentation workflow Set up Claude Code to help you write and maintain your Mintlify documentation. ## Prerequisites * Active Claude subscription (Pro, Max, or API access) ## Setup ```bash theme={null} npm install -g @anthropic-ai/claude-code ``` In your docs directory, run: ```bash theme={null} npx skills add https://mintlify.com/docs ``` This gives Claude Code Mintlify's component reference, writing standards, and workflow guidance. Edit `AGENTS.md` in your project root to add project-specific terminology, style preferences, and content boundaries. ```bash theme={null} claude ``` # Cursor setup Source: https://docs.lucenthq.com/ai-tools/cursor Configure Cursor for your documentation workflow Set up Cursor to help you write and maintain your Mintlify documentation. ## Prerequisites * Cursor editor installed ## Setup Open the root of your documentation repository where `docs.json` is located. In the integrated terminal, run: ```bash theme={null} npx skills add https://mintlify.com/docs ``` This gives Cursor Mintlify's component reference, writing standards, and workflow guidance. Edit `AGENTS.md` in your project root to add project-specific terminology, style preferences, and content boundaries. Open a file and use Cursor's AI features to draft and edit documentation. # Windsurf setup Source: https://docs.lucenthq.com/ai-tools/windsurf Configure Windsurf for your documentation workflow Set up Windsurf's Cascade AI assistant to help you write and maintain your Mintlify documentation. ## Prerequisites * Windsurf editor installed ## Setup Open the root of your documentation repository where `docs.json` is located. In the integrated terminal, run: ```bash theme={null} npx skills add https://mintlify.com/docs ``` This gives Windsurf Mintlify's component reference, writing standards, and workflow guidance. Edit `AGENTS.md` in your project root to add project-specific terminology, style preferences, and content boundaries. Open a file and use Cascade to draft and edit documentation. # Authentication Source: https://docs.lucenthq.com/api-reference/authentication How Lucent ingest keys and Data API bearer tokens are validated. Lucent uses different credentials for write-only ingest and bearer-token Data API access. | API | Credential | Where to use it | | ---------- | --------------------------------------------------------- | ------------------------------------------------------ | | Ingest API | `luc_pk_...` public key | `X-Lucent-Api-Key` header or `api_key` query parameter | | Data API | `luc_api_...` API key or `luc_oat_...` OAuth access token | `Authorization: Bearer ...` header | ## Ingest public keys All requests to the Lucent ingest API are authenticated with a **public key** issued from your dashboard. Public keys begin with `luc_pk_` and are scoped to a single organization. They are **write-only** — they can submit session data but cannot read anything back, which is why it is safe to embed them in client-side JavaScript. ## Key format ```text theme={null} luc_pk_7a4f9e2b6c1d3f... ``` Create and revoke keys at **Settings → SDK keys** in [app.lucenthq.com](https://app.lucenthq.com). ### Passing the key Lucent accepts the key in either an HTTP header *or* a query parameter. The header is preferred; the query parameter exists so that `navigator.sendBeacon` requests (which cannot set custom headers) can still authenticate on page unload. ```http theme={null} POST /api/sdk/replay HTTP/1.1 Host: batch-jobs-lucent.onrender.com Content-Type: application/json X-Lucent-Api-Key: luc_pk_... ``` ```http theme={null} POST /api/sdk/replay?api_key=luc_pk_... HTTP/1.1 Host: batch-jobs-lucent.onrender.com Content-Type: application/json ``` ### Ingest error responses * `{"error": "Missing API key"}` — no `X-Lucent-Api-Key` header or `api_key` query parameter was supplied. * `{"error": "Invalid or revoked API key"}` — the key is not recognized or has been revoked in the dashboard. Rate limit exceeded. The response includes a `Retry-After` header with the number of seconds until the limit resets. ### Ingest rate limits Each API key is limited to **100 requests per minute** per key, using a sliding‑window algorithm. With the SDK's default batching settings (`flushIntervalMs: 10_000`), a single browser session produces roughly 6 requests per minute — well under the limit. If you build a custom server‑side integration that aggregates many sessions through a single key, you may need multiple keys or a higher tier. Contact [support@lucenthq.com](mailto:support@lucenthq.com) if you run into limits. ### CORS The ingest API responds with `Access-Control-Allow-Origin: *`, so you can call it from any browser origin. The following headers are allowed on requests: * `Content-Type` * `Content-Encoding` (for gzipped bodies) * `X-Lucent-Api-Key` Preflight `OPTIONS` requests are handled automatically and require no special client configuration. ## Data API bearer tokens The [Data API](/api-reference/data-api) uses API keys and OAuth bearer tokens for reading data and updating issue status. ```http theme={null} GET /api/v1/issues HTTP/1.1 Host: app.lucenthq.com Authorization: Bearer luc_api_... ``` Supported token types: * `luc_api_...` — an API key created in **Organization settings → MCP** * `luc_oat_...` — an OAuth access token Legacy static keys with the `luc_mcp_` prefix continue to work. Bearer tokens are scoped to the organization that created or authorized them. You cannot override the organization with a request parameter. ### Data API scopes | Scope | Allows | | -------------- | ----------------------------------- | | `read:lucent` | Read issues, signals, and insights. | | `write:issues` | Update issue status. | API keys default to `read:lucent`. When creating an API key, enable **Allow issue status updates** to add `write:issues`. OAuth clients must request the scopes they need; unknown scopes are rejected. ### Data API error responses `{"error": "Missing or invalid bearer token"}` — no bearer token was supplied, the token prefix is not supported, the token was revoked, or the token is unknown. `{"error": "Missing required scope: write:issues"}` — the bearer token is valid but does not include the scope required by the endpoint. `401` responses include this challenge header: ```http theme={null} WWW-Authenticate: Bearer scope="read:lucent" ``` For write endpoints, the challenge uses `scope="write:issues"`. # Data API Source: https://docs.lucenthq.com/api-reference/data-api Read issues, signals, and insights over REST, and update issue status using bearer tokens. The Lucent Data API is a REST surface for reading Lucent data and updating issue status from scripts, dashboards, and services. ## Base URL ```text theme={null} https://app.lucenthq.com ``` All endpoints below are relative to this base URL. ## Authentication Send a bearer token in the `Authorization` header: ```bash theme={null} curl -sS https://app.lucenthq.com/api/v1/issues?limit=10 \ -H "Authorization: Bearer luc_api_..." ``` The Data API accepts API keys and OAuth access tokens: * API keys that start with `luc_api_` * OAuth access tokens that start with `luc_oat_` Legacy static keys with the `luc_mcp_` prefix continue to work. Read endpoints require `read:lucent`. Updating issue status requires `write:issues`. Create API keys in **Organization settings → MCP**. Choose **Allow issue status updates** when the key needs to call `PATCH /api/v1/issues/{issueId}`. OAuth clients should follow the [OAuth reference](/mcp/oauth) and request only the scopes they need. Browser dashboard sessions do not authenticate the Data API. These endpoints are for bearer-token clients and return JSON errors when the token is missing or invalid. ## Endpoints | Method | Path | Scope | Query params | Description | | ------- | ---------------------------------------------------------------- | -------------- | --------------------------- | ----------------------------------------- | | `GET` | [`/api/v1/issues`](/api-reference/list-issues) | `read:lucent` | `limit`, `status`, `cursor` | List issues for the token's organization. | | `GET` | [`/api/v1/issues/{issueId}`](/api-reference/get-an-issue) | `read:lucent` | — | Fetch a single issue by UUID. | | `PATCH` | [`/api/v1/issues/{issueId}`](/api-reference/update-issue-status) | `write:issues` | — | Update an issue's status. | | `GET` | [`/api/v1/signals`](/api-reference/list-signals) | `read:lucent` | `limit`, `cursor` | List configured signals and match counts. | | `GET` | [`/api/v1/insights`](/api-reference/list-insights) | `read:lucent` | `limit`, `cursor` | List recent AI-generated insights. | Every request is scoped to the organization that owns the token. There is no `orgId` query parameter. ## Limits | Endpoint | Default limit | Max limit | | ------------------ | ------------- | --------- | | `/api/v1/issues` | `25` | `200` | | `/api/v1/signals` | `50` | `200` | | `/api/v1/insights` | `25` | `100` | `limit` must be an integer within the endpoint's range. List endpoints are ordered by `createdAt` descending, then `id` descending. ## Pagination List responses include `nextCursor`: ```json theme={null} { "issues": [], "nextCursor": "eyJjcmVhdGVkQXQiOiIyMDI2LTAyLTI0VDEwOjMyOjE5LjA2NloiLCJpZCI6Ijg3YjNhNmI2LTVhZjUtNDM4Yi1hMzljLWVmZjE0OGE2OGNjYiJ9" } ``` If `nextCursor` is not `null`, pass it back as the `cursor` query parameter to fetch the next page: ```http theme={null} GET /api/v1/issues?limit=25&cursor=eyJjcmVhdGVkQXQiOiIyMDI2... Authorization: Bearer luc_api_... ``` The cursor is opaque. Do not parse or construct it yourself. ## Rate limits | Request type | Limit | | ------------ | ------------------------------------------------- | | Reads | 300 requests per minute per token or OAuth client | | Writes | 60 requests per minute per token or OAuth client | Rate-limited responses return `429` and include `Retry-After`, `X-RateLimit-Limit`, `X-RateLimit-Remaining`, and `X-RateLimit-Reset` headers. ## Errors All error responses are JSON and include `Cache-Control: no-store`. | Status | Example body | Meaning | | ------ | ------------------------------------------------------------------------------------ | -------------------------------------------------------------- | | `400` | `{"error":"limit must be an integer between 1 and 200"}` | Invalid query parameter. | | `400` | `{"error":"Request body must be valid JSON"}` | Invalid JSON body for a write request. | | `400` | `{"error":"status must be one of: unresolved, ticket_created, transient, resolved"}` | Invalid issue status. | | `401` | `{"error":"Missing or invalid bearer token"}` | Missing, malformed, revoked, or unknown bearer token. | | `403` | `{"error":"Missing required scope: write:issues"}` | The token is valid but lacks the required scope. | | `404` | `{"error":"Issue not found"}` | The requested issue was not found in the token's organization. | | `429` | `{"error":"Rate limit exceeded"}` | The token or OAuth client exceeded its per-minute limit. | `401` responses include: ```http theme={null} WWW-Authenticate: Bearer scope="read:lucent" ``` For write endpoints, the challenge scope is `write:issues`. # Replay Source: https://docs.lucenthq.com/api-reference/endpoint/replay POST /api/sdk/replay Accepts a batch of rrweb events for a single session window. Batches are idempotent per `(sessionId, sequence)` — the same batch submitted twice is stored once. When `flush` is `final`, the server dispatches the session for processing immediately; otherwise the session is left in a `receiving` state until a scheduled finalizer picks it up. # Get an issue Source: https://docs.lucenthq.com/api-reference/get-an-issue GET /api/v1/issues/{issueId} Fetches a single issue by UUID for the bearer token's organization. # Introduction Source: https://docs.lucenthq.com/api-reference/introduction The Lucent HTTP APIs for submitting session recordings, reading Lucent data, and updating issue status. Lucent exposes two HTTP APIs: | API | Base URL | Purpose | Auth | | -------------------------------------------- | ---------------------------------------- | -------------------------------------------------------- | --------------------------- | | [Ingest API](/api-reference/endpoint/replay) | `https://batch-jobs-lucent.onrender.com` | Submit session replay events. | `luc_pk_` public key | | [Data API](/api-reference/data-api) | `https://app.lucenthq.com` | Read issues, signals, and insights; update issue status. | `Authorization: Bearer ...` | The ingest API is what the [`@lucenthq/sdk`](/sdk/installation) package talks to in production. You can also call it directly from your own instrumentation — for example, a native mobile app that already speaks rrweb, or a server-side relay. The Data API exposes Lucent data over plain REST. Use it for scripts, dashboards, or services that need Lucent data or need to update issue status without using the dashboard. ## Ingest base URL ```text theme={null} https://batch-jobs-lucent.onrender.com ``` All endpoints are relative to this base URL. If you self‑host the ingest service, point the SDK at your own base URL via the `ingestBaseUrl` option. ## Endpoint | Method | Path | Purpose | | ------ | ----------------- | --------------------------------------------- | | `POST` | `/api/sdk/replay` | Submit a batch of rrweb events for a session. | See the [Replay endpoint](/api-reference/endpoint/replay) for the full request and response schema. ## Data API endpoints | Method | Path | Purpose | | ------- | -------------------------- | -------------------- | | `GET` | `/api/v1/issues` | List issues. | | `GET` | `/api/v1/issues/{issueId}` | Fetch one issue. | | `PATCH` | `/api/v1/issues/{issueId}` | Update issue status. | | `GET` | `/api/v1/signals` | List signals. | | `GET` | `/api/v1/insights` | List insights. | See the [Data API](/api-reference/data-api) page for authentication, query parameters, and response examples. The current `@lucenthq/sdk` browser package uses hardcoded defaults (`flushIntervalMs: 10000`, `maxEventsPerBatch: 500`, `maxBatchBytes: 1 MiB`) and posts directly to `/api/sdk/replay` without an init handshake. If you're building a custom integration on top of the ingest API, do the same — the only runtime endpoint you need is `/api/sdk/replay`. ## Authentication Ingest requests use `luc_pk_` public keys. Data API requests use API keys or OAuth bearer tokens with the `read:lucent` scope. See [Authentication](/api-reference/authentication) for both formats. ## Content encoding Replay batches can be large. The `/api/sdk/replay` endpoint accepts either plain JSON or gzip‑compressed JSON — set `Content-Encoding: gzip` on the request and the server will decompress the body before parsing. The browser SDK compresses by default. # List insights Source: https://docs.lucenthq.com/api-reference/list-insights GET /api/v1/insights Lists recent AI-generated insights for the bearer token's organization. # List issues Source: https://docs.lucenthq.com/api-reference/list-issues GET /api/v1/issues Lists issues visible to the bearer token's organization, ordered by `createdAt` descending and then `id` descending. # List signals Source: https://docs.lucenthq.com/api-reference/list-signals GET /api/v1/signals Lists configured signals and match counts for the bearer token's organization. # Update issue status Source: https://docs.lucenthq.com/api-reference/update-issue-status PATCH /api/v1/issues/{issueId} Updates an issue's status. The operation is idempotent: setting the current status again returns `200` with the unchanged issue. # Webhooks Source: https://docs.lucenthq.com/api-reference/webhooks Receive HTTP callbacks from Lucent when issues and other events happen in your organization. Webhooks let Lucent push events to your service in real time, instead of you polling the [Data API](/api-reference/data-api). When an event fires — for example, a new issue is created — Lucent makes a signed `POST` to the URL you register, with a JSON body describing the event. ## Available events | Event | When it fires | | --------------- | ------------------------------------------------------------ | | `issue.created` | A new issue is created from session analysis or AI insights. | More event types (`issue.status_changed`, `issue.recurred`, `signal.matched`, `insight.generated`) are on the roadmap. ## Register an endpoint Webhooks are configured per organization, in [**Organization → Webhooks**](https://app.lucenthq.com/organization). In the dashboard, go to [**Organization → Webhooks**](https://app.lucenthq.com/organization) and click **Add endpoint**. Enter: * a **name** (max 64 characters) * the **URL** Lucent should `POST` to (HTTPS, max 2048 characters) * the **events** you want delivered to this endpoint On save, Lucent shows the signing secret once. It looks like `whsec_…`. Store it somewhere safe (a secret manager, your `.env`). The dashboard only ever shows the prefix (`whsec_xxxx…`) again — there is no way to retrieve the full secret later. If you lose it, revoke the endpoint and create a new one. Use **Send test** to deliver a synthetic event of the type you chose. Test events carry the `Lucent-Webhook-Test: 1` header so you can branch on them in your handler. ### Limits * Up to **3 active endpoints per organization**. * Up to **5 endpoint creations per hour** per organization. * Test event sends are rate-limited per organization and per endpoint. Webhooks are available on paid plans. ## Payload shape Every delivery is a single JSON object with stable top-level fields: | Field | Type | Description | | ------------ | -------- | -------------------------------------------------------------------------------------------- | | `event` | `string` | The event type, e.g. `issue.created`. | | `id` | `uuid` | Envelope id. Identical across every retry of the same event — use it to dedupe on your side. | | `occurredAt` | `string` | ISO 8601 timestamp of when the event happened in Lucent. | | `data` | `object` | Event-specific payload. The shape depends on `event`. | ### `issue.created` ```json theme={null} { "event": "issue.created", "id": "ea0c8c0b-4f3d-4b1c-9e7a-d4b1c8e7a4f3", "occurredAt": "2026-05-12T08:42:13.512Z", "data": { "issueId": "9b1c0f8b-a4e2-4ff7-8c5b-7d8a9e2f4c1b", "orgId": "00000000-0000-0000-0000-000000000000", "title": "Checkout button unresponsive on mobile", "description": "Multiple sessions show the checkout button failing to register taps...", "status": "unresolved", "priority": "high", "previewUrl": null, "aiVerified": true, "sourceType": "session_analysis" } } ``` | `data` field | Type | Notes | | ------------- | ----------------- | -------------------------------------------------------------------------------------------------- | | `issueId` | `uuid` | The issue id. Use with [`GET /api/v1/issues/{issueId}`](/api-reference/get-an-issue). | | `orgId` | `uuid` | The Lucent organization that owns the issue. | | `title` | `string` | Short human-readable summary. | | `description` | `string \| null` | Long-form summary, truncated to 1,000 characters with `...` if longer. | | `status` | `string` | One of `unresolved`, `ticket_created`, `transient`, `resolved`. | | `priority` | `string` | One of `critical`, `high`, `medium`, `low`. | | `previewUrl` | `string \| null` | URL to a preview frame of the offending session, if available. | | `aiVerified` | `boolean \| null` | Whether AI verification has run and confirmed the issue. | | `sourceType` | `string` | `session_analysis` (issue derived from a session) or `insight` (issue derived from an AI insight). | ## Headers | Header | Example | Notes | | --------------------- | -------------------------------------- | -------------------------------------------------------------------------------------- | | `Lucent-Signature` | `t=1715500000,v1=3c35a6b4…` | HMAC-SHA256 over `${t}.${rawBody}`. See [Verify the signature](#verify-the-signature). | | `Lucent-Webhook-Id` | `ea0c8c0b-4f3d-4b1c-9e7a-d4b1c8e7a4f3` | Same value as the body's `id`. Identical across all retries — persist for dedup. | | `Lucent-Event` | `issue.created` | The event type. Same value as the body's `event`. | | `Content-Type` | `application/json` | | | `User-Agent` | `Lucent-Webhooks/1.0` | | | `Lucent-Webhook-Test` | `1` | Only present on test events sent from the dashboard. | ## Verify the signature Lucent signs every delivery using a Stripe-compatible scheme: HMAC-SHA256 over `${timestamp}.${rawBody}`, using your endpoint's signing secret as the key. The `Lucent-Signature` header is a comma-separated key/value list: ```text theme={null} Lucent-Signature: t=1715500000,v1=3c35a6b4d9e2f0... ``` * `t` — Unix timestamp (seconds) of when Lucent generated the signature. * `v1` — hex-encoded HMAC-SHA256. To verify: 1. Read the **raw** request body. Sign the bytes Lucent sent — re-serializing parsed JSON will not match. 2. Recompute `HMAC_SHA256(secret, "${t}.${rawBody}")`. 3. Compare with `v1` in constant time. 4. Reject the request if `t` is more than 5 minutes from your server clock — this prevents replay of an old, valid request. ```ts Node.js theme={null} import crypto from "node:crypto"; function verifyLucentSignature( rawBody: string, signatureHeader: string, secret: string, ) { // signatureHeader looks like: "t=1715500000,v1=3c35a6b4..." const parts = Object.fromEntries( signatureHeader.split(",").map((p) => { const [k, v] = p.split("=", 2); return [k, v ?? ""]; }), ); const t = parts.t; const v1 = parts.v1; if (!t || !v1) return false; // Reject replays older than 5 minutes. const ageSec = Math.floor(Date.now() / 1000) - Number(t); if (Number.isNaN(ageSec) || Math.abs(ageSec) > 300) return false; const expected = crypto .createHmac("sha256", secret) .update(`${t}.${rawBody}`) .digest("hex"); // timingSafeEqual throws if buffers differ in length — guard first. const expectedBuf = Buffer.from(expected); const v1Buf = Buffer.from(v1); if (expectedBuf.length !== v1Buf.length) return false; return crypto.timingSafeEqual(expectedBuf, v1Buf); } ``` ```python Python theme={null} import hmac import hashlib import time def verify_lucent_signature(raw_body: str, signature_header: str, secret: str) -> bool: # signature_header looks like: "t=1715500000,v1=3c35a6b4..." parts = {} for segment in signature_header.split(","): if "=" not in segment: continue k, v = segment.split("=", 1) parts[k] = v t = parts.get("t") v1 = parts.get("v1") if not t or not v1: return False # Reject replays older than 5 minutes. try: t_int = int(t) except ValueError: return False if abs(int(time.time()) - t_int) > 300: return False signed = f"{t}.{raw_body}".encode() expected = hmac.new(secret.encode(), signed, hashlib.sha256).hexdigest() # compare_digest is naturally length-tolerant. return hmac.compare_digest(expected, v1) ``` Read the raw request body before any JSON parsing or middleware that might rewrite it. In Express, mount `express.raw({ type: "application/json" })` for the webhook route. In Next.js Route Handlers, use `await request.text()`. ## Retries and idempotency * Delivery has a **10-second per-request timeout**. * Non-2xx responses, timeouts, and network errors trigger a **retry** — up to **3 retries** with exponential backoff after the initial attempt. * The same `Lucent-Webhook-Id` is sent on every attempt. Persist it on success and treat duplicate ids as no-ops. * Lucent recomputes the signature on each retry, so `t` (and the `Lucent-Signature` value) will differ between attempts. The body bytes and `Lucent-Webhook-Id` stay the same. * Because the timeout is 10 seconds, your handler should **acknowledge fast**: validate the signature, enqueue the work, and return `200`. Do the actual processing asynchronously. ## Security model Webhook URLs go through several checks before every delivery, not just at creation: * **HTTPS only.** Plain `http://` URLs are rejected. URLs with `user:pass@` credentials are also rejected — `fetch` would silently send them as Basic auth. * **Public destinations only.** The hostname is resolved fresh on every delivery and its IPs are checked against `ipaddr.js` ranges. Loopback, private, link-local, and other non-unicast addresses are rejected. This defends against DNS rebinding (an attacker-controlled hostname pointing at `127.0.0.1` between checks). * **Service ports are blocked.** Common service ports — SSH (22), SMTP (25), Postgres (5432), MySQL (3306), Redis (6379), Mongo (27017), Elasticsearch (9200/9300), Memcached (11211), Docker (2375/2376), and others — are rejected so webhooks can't be used to probe internal infrastructure. * **Redirects are not followed.** Set the final URL on your endpoint directly. If a delivery is blocked for any of these reasons, the endpoint's last delivery status is recorded as `url_unsafe` and no request leaves Lucent. ## Endpoint management Each endpoint surfaces, in [**Organization → Webhooks**](https://app.lucenthq.com/organization): * last delivery time and HTTP status * last delivery error label, if any (`bad_status:NNN`, `timeout`, `tls_error`, `network_error`, `url_unsafe`) * a **Send test** button * a **Revoke** button — revoked endpoints stop receiving deliveries immediately and free a slot against the per-org cap. The full signing secret is shown only at creation. The dashboard always shows the prefix (`whsec_xxxx…`) so you can tell endpoints apart without exposing the secret. # Welcome to Lucent Source: https://docs.lucenthq.com/index Session replay and product insights that show you exactly what happened. Lucent records real user sessions in your web app, stores them securely, and turns them into signals you can act on — rage clicks, dead clicks, broken flows, and AI‑generated insights that explain *why* a session went sideways. ## Start here Install the browser SDK and record your first session in under five minutes. `@lucenthq/sdk` — a lightweight rrweb‑based recorder for any web app. `@lucenthq/react-native` records screenshot-mode replay in mobile apps. HTTP endpoints for self‑hosted and server‑side integrations. View recorded sessions, filter by signal, and manage API keys. ## How Lucent works 1. **Record** — drop `@lucenthq/sdk` into your app. It uses rrweb under the hood to capture DOM mutations, clicks, inputs, console output, and network calls, with a privacy‑first default that masks all text. 2. **Ingest** — events are batched in the browser and flushed to Lucent's ingest API. Sessions are stored immutably and processed asynchronously. 3. **Analyze** — Lucent detects rage clicks, dead clicks, and navigation friction, then runs an AI analysis pass over each session to surface the issues that matter. 4. **Act** — review signals in the dashboard, share links with your team, or pipe them into your issue tracker. Ready? Head to the [Quickstart](/quickstart). # Sentry replay Source: https://docs.lucenthq.com/integrations/sentry Connect Sentry Session Replay to Lucent. Connect Sentry to import Session Replay recordings into Lucent. Lucent reads Sentry replay metadata and recording segments, then analyzes the imported session alongside your other Lucent sessions. ## What Lucent imports Lucent uses Sentry's replay APIs for replay metadata and recording segments: * [List an organization's replays](https://docs.sentry.io/api/replays/list-an-organizations-replays/) * [Retrieve a replay instance](https://docs.sentry.io/api/replays/retrieve-a-replay-instance/) * [List recording segments](https://docs.sentry.io/api/replays/list-recording-segments/) * [Retrieve a recording segment](https://docs.sentry.io/api/replays/retrieve-a-recording-segment/) ## Requirements You need: * a Sentry organization slug * a Sentry project slug or project ID * a Sentry auth token * an optional environment filter, such as `production` Use a Sentry token with `org:read` and `project:read`. ## Connect Sentry In Sentry, create an auth token with `org:read` and `project:read`. In Lucent, go to **Settings -> Integrations** and select **Sentry**. Add your Sentry host, organization slug, Sentry project slug or ID, token, and optional environment. Lucent checks replay and recording segment access before saving. The default Sentry host is `https://sentry.io`. If you use a self-hosted Sentry deployment, enter your own host. ## Mobile and Expo replay support Sentry web replay is supported. Sentry mobile and Expo replay import is beta: * DOM-like rrweb payloads pass through unchanged. * screenshot-style mobile payloads are converted before video generation. * wireframe-style mobile payloads are converted before video generation. Other mobile replay payloads are skipped. ## After import Imported Sentry sessions keep their source metadata, so you can: * open the original replay link from the session detail view * filter imported sessions and Signals by replay provider * filter Signals by feature flag values when available ## Troubleshooting | Problem | What to check | | ---------------------------------- | -------------------------------------------------------------------------------------------------------------------- | | Lucent cannot save the integration | Confirm the token has `org:read` and `project:read`, and that the Sentry organization and project slugs are correct. | | No sessions import | Check the environment filter and confirm the Sentry project has replays in the selected time window. | | A mobile replay is skipped | The replay did not contain renderable DOM, screenshot, or wireframe data. | # Session replay integrations Source: https://docs.lucenthq.com/integrations/session-replay Import sessions from supported replay providers and use them in Lucent Signals. Lucent analyzes replay data from Lucent SDKs and supported third-party replay providers. ## Supported sources | Source | Web replay | Mobile replay | Notes | | ---------- | ---------- | ----------------------------------------------------------------------------- | -------------------------------------------------------------------------------- | | Lucent SDK | Supported | Supported with `@lucenthq/react-native` screenshot replay | Browser and React Native sessions captured directly by Lucent. | | PostHog | Supported | Supported when the payload contains DOM, screenshot, or wireframe replay data | Unknown mobile payloads are skipped. | | Datadog | Supported | Supported when exported events are renderable as rrweb | Source metadata is preserved on imported sessions. | | Amplitude | Supported | Supported when exported events are renderable as rrweb | Source metadata is preserved on imported sessions. | | Sentry | Supported | Beta for Sentry mobile and Expo replay payloads | Mobile screenshot and wireframe payloads are transformed before video rendering. | ## Mobile replay handling Lucent normalizes supported mobile payloads before video generation: * DOM-like rrweb payloads pass through. * Screenshot-style payloads are converted into web-compatible rrweb. * Wireframe-style payloads are converted into web-compatible rrweb. * Unknown mobile payloads are skipped. Lucent React Native replay uses screenshot payloads with `snapshotSource: "mobile"`, `snapshotLibrary: "lucent-react-native"`, and `snapshotMode: "screenshot"`. After normalization, supported mobile sessions follow the same analysis path as web sessions. ## Processing controls Product Context and processing filters apply to the current project selected in the app header. Filters and sampling usually control whether a session is analyzed, not whether an SDK can send events. Required URL filters apply before full analysis and are fail-closed. If the selected project has Required URL patterns and a session has no matching URL or screen evidence, Lucent skips that session from analysis as `required_url_missing` while still allowing SDK replay ingestion. For first-party React Native and Expo replay, use path-style screen names such as `/onboarding` when you want mobile sessions to match Required or Excluded URL filters. See [React Native processing controls](/sdk/react-native#processing-controls). ## Provider metadata Lucent preserves replay source metadata such as replay provider, provider project, replay URL, platform, and feature flag values when available. ## Related guides Connect Sentry Session Replay and import web, mobile, and Expo sessions. Capture first-party mobile replay with `@lucenthq/react-native`. Filter Signals by evaluated feature flags from SDK sessions and integrations. # OAuth reference Source: https://docs.lucenthq.com/mcp/oauth Protocol-level details for the Lucent OAuth 2.1 authorization server that fronts the MCP endpoint. Lucent's MCP endpoint is fronted by an OAuth 2.1 authorization server that conforms to the [MCP specification](https://modelcontextprotocol.io). For the user-facing setup walkthrough, see the [quickstart](/mcp/quickstart). This page documents the protocol surface for client implementers. ## Discovery Both metadata documents are publicly readable and CORS-open. ### Protected resource metadata `GET https://app.lucenthq.com/.well-known/oauth-protected-resource` Returns the resource server's identity and which authorization servers issue tokens for it. ```json theme={null} { "resource": "https://app.lucenthq.com/api/mcp", "authorization_servers": ["https://app.lucenthq.com"], "scopes_supported": ["read:lucent"] } ``` ### Authorization server metadata `GET https://app.lucenthq.com/.well-known/oauth-authorization-server` Returns the endpoints, supported parameters, and capabilities. ```json theme={null} { "issuer": "https://app.lucenthq.com", "authorization_endpoint": "https://app.lucenthq.com/oauth/authorize", "token_endpoint": "https://app.lucenthq.com/api/oauth/token", "registration_endpoint": "https://app.lucenthq.com/api/oauth/register", "revocation_endpoint": "https://app.lucenthq.com/api/oauth/revoke", "response_types_supported": ["code"], "grant_types_supported": ["authorization_code", "refresh_token"], "token_endpoint_auth_methods_supported": ["none", "client_secret_post"], "revocation_endpoint_auth_methods_supported": ["none", "client_secret_post"], "code_challenge_methods_supported": ["S256"], "scopes_supported": ["read:lucent"] } ``` The only supported grant flow is **authorization code with PKCE (S256)**. Implicit, password, and `client_credentials` are not supported. `plain` PKCE is rejected. ## Dynamic Client Registration `POST https://app.lucenthq.com/api/oauth/register` Implements [RFC 7591](https://datatracker.ietf.org/doc/html/rfc7591). Rate-limited per IP — busy clients should cache the resulting `client_id` rather than re-register. **Request** ```json theme={null} { "client_name": "Acme Connector", "redirect_uris": ["https://claude.ai/api/mcp/auth_callback"], "token_endpoint_auth_method": "none", "grant_types": ["authorization_code", "refresh_token"], "response_types": ["code"], "scope": "read:lucent" } ``` | Field | Required | Notes | | ---------------------------- | -------- | ---------------------------------------------------------------------------------------------- | | `redirect_uris` | yes | At least one. Each must be in the [allowlist](#allowed-redirect-uris). HTTPS or loopback only. | | `client_name` | no | ≤ 64 chars; letters, numbers, spaces, `-_.()`. Defaults to `Unnamed Client`. | | `token_endpoint_auth_method` | no | `none` (public client + PKCE, default) or `client_secret_post`. | | `grant_types` | no | Subset of `["authorization_code", "refresh_token"]`. Defaults to both. | | `response_types` | no | Must include `code`. Defaults to `["code"]`. | | `scope` | no | Defaults to `read:lucent`. | **Response (`201 Created`)** ```json theme={null} { "client_id": "luc_client_…", "client_secret": "…", "client_name": "Acme Connector", "redirect_uris": ["https://claude.ai/api/mcp/auth_callback"], "token_endpoint_auth_method": "none", "grant_types": ["authorization_code", "refresh_token"], "response_types": ["code"], "scope": "read:lucent" } ``` `client_secret` is only present when `token_endpoint_auth_method` is `client_secret_post`. Public clients (the default for native MCP clients) get `client_id` only and authenticate with PKCE. ### Allowed redirect URIs The redirect allowlist defends against open-redirect and auth-code injection. Registration rejects URIs outside this list with an `InvalidClientMetadataError` and an opaque message. | Type | Allowed values | | --------------- | -------------------------------------------------------------------------- | | Hosted (HTTPS) | `https://claude.ai`, `https://claude.com` | | Loopback (HTTP) | `http://127.0.0.1`, `http://[::1]`, `http://localhost` — any port and path | URIs with embedded credentials (`https://user:pass@…`) or fragments (`#…`) are rejected per RFC 6749 §3.1.2. To add another hosted origin, email [support@lucenthq.com](mailto:support@lucenthq.com). ## Authorization request `GET https://app.lucenthq.com/oauth/authorize?…` Standard OAuth 2.1 authorization-code request with PKCE: | Param | Required | Notes | | ----------------------- | -------- | --------------------------------------------------------- | | `response_type` | yes | Must be `code`. | | `client_id` | yes | From registration. | | `redirect_uri` | yes | Must exactly match one of the registered `redirect_uris`. | | `code_challenge` | yes | 43–128 chars, base64url-encoded SHA-256 of the verifier. | | `code_challenge_method` | yes | Must be `S256`. | | `state` | rec. | Opaque value the client uses for CSRF protection. | | `scope` | no | Defaults to `read:lucent`. | If the user isn't signed in to Lucent, they're routed through `/login` and returned to the consent screen after authentication. If a consent record already exists for this `(client_id, scope)` and hasn't been revoked, the consent screen is bypassed and the browser is redirected back to `redirect_uri` with `?code=…&state=…` immediately. If anything is wrong (unknown client, revoked client, redirect\_uri mismatch, malformed PKCE), the user sees a single opaque error page — no detail is leaked that would let an unauthenticated probe enumerate client state. ## Token endpoint `POST https://app.lucenthq.com/api/oauth/token` `Content-Type: application/x-www-form-urlencoded`. Returns `Cache-Control: no-store`. ### `grant_type=authorization_code` ```http theme={null} POST /api/oauth/token HTTP/1.1 Content-Type: application/x-www-form-urlencoded grant_type=authorization_code &code=luc_oac_… &redirect_uri=https://claude.ai/api/mcp/auth_callback &client_id=luc_client_… &code_verifier=… &client_secret=… (only if token_endpoint_auth_method=client_secret_post) ``` The `redirect_uri` must match the value sent at authorize time (RFC 6749 §4.1.3 / OAuth 2.1 §4.1.3). Codes are single-use and expire after 60 seconds. Reuse of an already-redeemed code revokes any tokens previously issued from it. ### `grant_type=refresh_token` ```http theme={null} grant_type=refresh_token &refresh_token=luc_ort_… &client_id=luc_client_… &scope=read:lucent (optional, must be ⊆ originally granted) &client_secret=… (only if confidential client) ``` Refresh tokens **rotate** on every exchange — the old refresh token is marked rotated and a new pair is returned. If a rotated refresh token is presented again, the entire token chain (access + refresh) for that session is revoked as a reuse-detection cascade. ### Response ```json theme={null} { "access_token": "luc_oat_…", "refresh_token": "luc_ort_…", "token_type": "Bearer", "expires_in": 3600, "scope": "read:lucent" } ``` | TTL | Default | Env var | | ------------------ | ---------- | -------------------------------------- | | Access token | 1 hour | `OAUTH_ACCESS_TOKEN_TTL_SECONDS` | | Refresh token | 30 days | `OAUTH_REFRESH_TOKEN_TTL_DAYS` | | Authorization code | 60 seconds | `OAUTH_AUTHORIZATION_CODE_TTL_SECONDS` | ## Revocation endpoint `POST https://app.lucenthq.com/api/oauth/revoke` Implements [RFC 7009](https://datatracker.ietf.org/doc/html/rfc7009) and is idempotent — always returns `200` even for unknown tokens. ```http theme={null} POST /api/oauth/revoke HTTP/1.1 Content-Type: application/x-www-form-urlencoded token=luc_oat_… or luc_ort_… &token_type_hint=access_token | refresh_token (optional) &client_id=luc_client_… &client_secret=… (only if confidential client) ``` Use this when a user signs out of your client. Lucent also exposes a **Connected apps** section in the dashboard so end users can unilaterally revoke any registered client. ## Tools and scopes Every token carries the `read:lucent` scope, which gates the whole MCP handler via `withMcpAuth({ requiredScopes: ["read:lucent"] })` and covers the four read tools (`list_signals`, `list_issues`, `get_issue`, `list_insights`). The write tool, `update_issue`, additionally requires `write:issues` — clients must request that scope during authorization, and tokens without it get a missing-scope error from the tool. See the [tool reference](/mcp/tools) for arguments and return shapes. ## Errors OAuth-protocol errors follow the [RFC 6749 §5.2](https://datatracker.ietf.org/doc/html/rfc6749#section-5.2) JSON shape: ```json theme={null} { "error": "invalid_grant", "error_description": "PKCE verification failed" } ``` User-visible authorize-page failures collapse to a single opaque message. Token-endpoint client-auth failures are also opaque (no distinction between "unknown client\_id" and "wrong secret") — both defenses are deliberate and prevent enumeration of registered clients. # MCP quickstart Source: https://docs.lucenthq.com/mcp/quickstart Connect Claude, Cursor, Claude Desktop, or any MCP-compatible client to your Lucent data. Lucent exposes a [Model Context Protocol](https://modelcontextprotocol.io) server so any MCP-compatible client — claude.ai, Claude Desktop, Claude Code, Cursor, Windsurf, Codex, VS Code — can query your organization's signals, issues, and insights directly. The server runs at `https://app.lucenthq.com/api/mcp`. Tokens are read-only by default: agents can list and fetch data. The one write operation, [`update_issue`](/mcp/tools#update-issue), requires the `write:issues` scope — grant it by checking **Allow issue status updates** when creating an API key. ## Two ways to connect Lucent supports both authentication methods MCP clients use today. | Method | Best for | How it works | | ----------------------- | ---------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------- | ------------------------------------------------------------------------------------------------------------------------------------------- | | **OAuth (recommended)** | Hosted MCP clients that auto-discover OAuth — claude.ai custom connectors and Claude Desktop via remote MCP today. Other clients can adopt it as their MCP transports add OAuth support. | The client redirects you to Lucent's consent screen, you approve once, and it gets a refreshing access token automatically — no copy/paste. | | **Static bearer token** | Clients without OAuth support, CI scripts, smoke tests, or anything that needs a stable long-lived credential. | Mint a `luc_mcp_…` token in **Organization settings → MCP** and paste it into the client's config. | Both methods hit the same endpoint and return the same tools. The MCP endpoint dispatches by token prefix (`luc_oat_…` for OAuth, `luc_mcp_…` for static), so existing static-token integrations keep working unchanged. Pick OAuth if your client supports it. ## Option A — OAuth flow Use this for any client that supports remote MCP with OAuth (claude.ai "custom connectors", Claude Desktop's remote-MCP support, etc.). In your MCP client, add a new server pointing at `https://app.lucenthq.com/api/mcp`. The client will discover Lucent's OAuth endpoints automatically via `/.well-known/oauth-protected-resource` and `/.well-known/oauth-authorization-server`. Your browser opens to Lucent's consent screen. Sign in if you aren't already, then review: * The client name (every DCR-registered app is shown with a **Third-party** badge — verify the redirect URL matches the tool you actually opened). * The requested scopes (`read:lucent`, plus `write:issues` if the client asked for issue-update access). * The redirect URL the auth code will be returned to. Leave **Remember this choice** ticked (default) so future requests from the same client don't prompt again. Click **Approve**. The client gets an access token (1 hour TTL) and a refresh token (30 days). It rotates them transparently — you don't see or copy anything. As long as the client refreshes at least once every 30 days and you don't revoke the consent, it stays connected indefinitely. Under **Organization settings → MCP → Connected apps**, you can see every OAuth client that has authorized your org and revoke any of them with one click. Revoke immediately invalidates all of that client's outstanding tokens. Lucent uses RFC 7591 Dynamic Client Registration with PKCE (S256) and rotating refresh tokens. See the [OAuth reference](/mcp/oauth) for protocol-level details. ### Currently allowed origins Lucent's OAuth surface only redirects back to a vetted set of origins, to defend against open-redirect and auth-code injection. Hosted MCP clients are accepted from: * `https://claude.ai` * `https://claude.com` Native MCP clients can register loopback redirect URIs (`http://127.0.0.1:`, `http://[::1]:`, `http://localhost:`). If you'd like another hosted client added, email [support@lucenthq.com](mailto:support@lucenthq.com). ## Option B — Static bearer token Use this for CLI clients and editors that don't speak OAuth, or for scripts that need a stable token. Open [**Organization settings → MCP**](https://app.lucenthq.com/organization?tab=mcp) in your Lucent Dashboard. Give the token a name so you can identify it later (e.g. `my laptop`, `cursor-prod`). Names are free text up to 64 characters. The token is shown **once** in a dialog and starts with `luc_mcp_…`. This is the only time the plaintext is visible. Lucent stores a SHA-256 hash, not the original token. If you lose it, revoke it and create a new one. ### Configure your client The dashboard auto-fills the snippets below with your real token until you navigate away — copy whichever one matches your client. Register the server once for the current project: ```bash theme={null} claude mcp add --transport http lucent https://app.lucenthq.com/api/mcp \ --header "Authorization: Bearer luc_mcp_..." ``` Claude Code stores this in `~/.claude.json` and sends the bearer header on every request. Run `/mcp` inside Claude Code to confirm the connection and list the tools. Cursor speaks streamable HTTP natively — no proxy needed. Open **Settings → MCP → Add new server** and paste: ```json theme={null} { "mcpServers": { "lucent": { "url": "https://app.lucenthq.com/api/mcp", "headers": { "Authorization": "Bearer luc_mcp_..." } } } } ``` Edit `~/Library/Application Support/Claude/claude_desktop_config.json` (macOS) or the equivalent on your platform, then restart the app: ```json theme={null} { "mcpServers": { "lucent": { "command": "npx", "args": [ "-y", "mcp-remote", "https://app.lucenthq.com/api/mcp", "--header", "Authorization: Bearer luc_mcp_..." ] } } } ``` `mcp-remote` proxies streamable HTTP for clients that haven't implemented it natively. Add to `~/.codex/config.toml` and restart the CLI: ```toml theme={null} [mcp_servers.lucent] command = "npx" args = ["-y", "mcp-remote", "https://app.lucenthq.com/api/mcp", "--header", "Authorization: Bearer luc_mcp_..."] ``` Add to `.vscode/mcp.json` in your workspace (requires GitHub Copilot with MCP support): ```json theme={null} { "servers": { "lucent": { "type": "http", "url": "https://app.lucenthq.com/api/mcp", "headers": { "Authorization": "Bearer luc_mcp_..." } } } } ``` Add to `~/.codeium/windsurf/mcp_config.json` and reload Windsurf: ```json theme={null} { "mcpServers": { "lucent": { "command": "npx", "args": [ "-y", "mcp-remote", "https://app.lucenthq.com/api/mcp", "--header", "Authorization: Bearer luc_mcp_..." ] } } } ``` Verify the endpoint and token work end-to-end: ```bash theme={null} curl -sS -X POST https://app.lucenthq.com/api/mcp \ -H "Authorization: Bearer luc_mcp_..." \ -H "Content-Type: application/json" \ -H "Accept: application/json, text/event-stream" \ -d '{"jsonrpc":"2.0","id":1,"method":"tools/list"}' ``` An OAuth access token (`luc_oat_...`) works in the same `Authorization` header — the MCP endpoint accepts both prefixes. ## Try a tool Once the client is connected, ask your agent a question that needs your Lucent data: * *"What are my most critical unresolved issues right now?"* → `list_issues` * *"Show me issue 87b3a6b6-5af5-438b-a39c-eff148a68ccb."* → `get_issue` * *"What signals have I configured and which are matching most?"* → `list_signals` * *"Summarize the last week of insights."* → `list_insights` See the [tool reference](/mcp/tools) for the full set of arguments and return shapes. ## Security model * **Read-only.** The MCP server exposes no write tools. Agents cannot create, update, or delete data in your org. * **Organization-scoped.** Every tool query compiles to `WHERE org_id = ?` where `org_id` comes exclusively from the token's auth context. There is no way for a client to override it. * **192-bit token entropy.** All tokens (`luc_mcp_`, `luc_oat_`, `luc_ort_`, `luc_oac_`) are 24 random bytes from a CSPRNG, encoded with `base64url`. The prefix lets you spot them in configs. * **SHA-256 hashed at rest.** Plaintext tokens are never stored on disk or in logs — only the hex digest. * **PKCE (S256) is required** for the OAuth code grant — no `plain` challenges, no implicit grant. * **Refresh-token rotation.** Each refresh issues a new pair and invalidates the previous refresh. Reuse of a rotated refresh token revokes the entire chain (RFC 6819 §5.2.1.1). * **Auth-code single-use.** Authorization codes expire in 60 seconds and are bound to a `redirect_uri`. Reusing a code revokes any tokens previously issued from it. * **Per-token usage timestamps.** The `Last used` columns in the dashboard show recent activity for both static tokens and OAuth clients. Revoke and rotate if anything looks off. * **Instant revocation.** Revoking either a static token or a connected OAuth app sets `revoked_at`; the next request returns `401` immediately. ## Troubleshooting Your client likely couldn't reach the OAuth discovery endpoint. Confirm you can `GET https://app.lucenthq.com/.well-known/oauth-protected-resource` and it returns valid JSON (not an HTML page). If it's blocked by a corporate proxy, add an exception. Check that your client is sending the `Authorization: Bearer ...` header. Confirm the token wasn't revoked in the dashboard (Organization settings → MCP). Static tokens start with `luc_mcp_`; OAuth access tokens start with `luc_oat_`. Token comparison is exact — no trailing whitespace, full prefix required. Lucent returns a single opaque error for every authorize-time failure (unknown `client_id`, mismatched `redirect_uri`, malformed PKCE parameters) so an attacker can't enumerate registered clients. The most common cause is a `redirect_uri` whose origin isn't in our allowlist (`https://claude.ai`, `https://claude.com`, or loopback). Re-register the connector in your MCP client and try again. Likely the connected app was revoked from **Organization settings → MCP → Connected apps** — that nukes its outstanding access and refresh tokens. The next request from the client should trigger a fresh OAuth flow (consent screen included, since the prior consent record was also revoked). The streamable HTTP transport is the only supported transport. If your client is trying to fall back to legacy SSE (`/api/sse` or `/api/message`), upgrade to a client that supports streamable HTTP or use `mcp-remote` as a proxy. Static tokens are only visible once, at creation time. Revoke the token in **Organization settings → MCP** and create a new one. OAuth clients don't have this problem — re-authorize from the client and a new token is minted. # Tool reference Source: https://docs.lucenthq.com/mcp/tools The five tools the Lucent MCP server exposes to agents — four read tools and one write tool. All five tools are registered under the MCP server at `https://app.lucenthq.com/api/mcp` and scoped automatically to the organization that owns the bearer token. There is no way to pass an `orgId` argument — your token IS the scope. Every tool returns a single JSON-stringified payload in a `text` content block. The shapes below are what you'll see once the client parses that JSON. Every tool also accepts an optional `prompt` argument: the user request that caused the tool call. Clients should pass it through when they can — it gives the audit trail context for why an agent read or changed something. ## `list_signals` List signals configured for the organization, with match counts and last-match timestamps. **Arguments** | Name | Type | Default | Description | | ------- | ------- | ------- | ---------------------------------- | | `limit` | integer | `50` | Max rows to return. Range `1–200`. | **Returns** ```json theme={null} [ { "id": "d3f0a2c4-...", "name": "Empty cart after checkout", "prompt": "Flag any session where the cart empties unexpectedly...", "runMode": "ongoing", "status": "active", "createdAt": "2026-03-14T22:10:04.512Z", "matchCount": 17, "lastMatchAt": "2026-04-14T08:41:22.103Z" } ] ``` Ordered by `createdAt` descending. `matchCount` is a LEFT JOIN count of rows in `signal_instances`; `lastMatchAt` is the most recent instance timestamp or `null` if the signal has never matched. ## `list_issues` List issues for the organization, optionally filtered by status. **Arguments** | Name | Type | Default | Description | | -------- | ------------------------------------------------------------------- | ------- | ---------------------------------- | | `limit` | integer | `25` | Max rows to return. Range `1–200`. | | `status` | `"unresolved"` \| `"ticket_created"` \| `"ignored"` \| `"resolved"` | — | Filter by issue status. | **Returns** ```json theme={null} [ { "id": "87b3a6b6-5af5-438b-a39c-eff148a68ccb", "title": "Payment processing fails with generic server error message during checkout", "description": "Users are unable to complete the booking process...", "status": "unresolved", "priority": "critical", "previewUrl": "https://.../issue-screenshots/87b3a6b6.png", "createdAt": "2026-02-24T10:32:19.066Z", "sessionCount": 1, "linearIssueUrl": null, "linearIssueIdentifier": null } ] ``` Ordered by `createdAt` descending. `sessionCount` is the number of session replays that triggered this issue. `linearIssueUrl` and `linearIssueIdentifier` are populated when the issue has been promoted to a Linear ticket, otherwise `null`. ## `get_issue` Fetch a single issue by ID, scoped to the organization. **Arguments** | Name | Type | Description | | --------- | ------------------------ | ------------------------------- | | `issueId` | string (uuid) — required | The UUID of the issue to fetch. | **Returns** ```json theme={null} { "id": "87b3a6b6-5af5-438b-a39c-eff148a68ccb", "title": "Payment processing fails with generic server error message during checkout", "description": "Users are unable to complete the booking process...", "stepsToReplicate": "1. Add a listing to the cart\n2. Proceed to checkout\n3. Fill in valid payment details\n4. Click 'Complete booking'\n...", "status": "unresolved", "priority": "critical", "previewUrl": "https://.../issue-screenshots/87b3a6b6.png", "aiVerified": true, "createdAt": "2026-02-24T10:32:19.066Z", "updatedAt": "2026-02-24T10:32:19.066Z", "linearIssueUrl": null, "linearIssueIdentifier": null } ``` Returns `isError: true` with a "No issue found with id " message if the issue doesn't exist or belongs to a different organization. Unlike `list_issues`, `get_issue` includes `stepsToReplicate` and `aiVerified` — heavier fields that aren't worth returning in bulk. ## `update_issue` Update an issue's status — mark it resolved after a fix ships, ignore a false positive, or reopen a regression. This is the only write tool, and the only one that requires the `write:issues` scope. **Arguments** | Name | Type | Description | | --------- | ------------------------------------------------------------------------------ | -------------------------------- | | `issueId` | string (uuid) — required | The UUID of the issue to update. | | `status` | `"unresolved"` \| `"ticket_created"` \| `"ignored"` \| `"resolved"` — required | The new status. | **Returns** The updated issue, in the same shape as `get_issue`. Returns `isError: true` with `Missing required scope: write:issues` if the token lacks the scope, or `No issue found with id {issueId}` if the issue doesn't exist or belongs to a different organization. The same operation is available over REST as [`PATCH /api/v1/issues/{issueId}`](/api-reference/update-issue-status). ## `list_insights` List the most recent insights (periodic session summaries) for the organization. **Arguments** | Name | Type | Default | Description | | ------- | ------- | ------- | ---------------------------------- | | `limit` | integer | `25` | Max rows to return. Range `1–100`. | **Returns** ```json theme={null} [ { "id": "f2b1c0e8-...", "createdAt": "2026-04-14T00:00:00.000Z", "intervalStart": "2026-04-07T00:00:00.000Z", "intervalEnd": "2026-04-14T00:00:00.000Z", "sessionsCount": 342, "content": { "positive": [...], "negative": [...] } } ] ``` Ordered by `createdAt` descending. Each row covers the window from `intervalStart` to `intervalEnd` and summarizes `sessionsCount` sessions that completed in that window. The `content` field is the structured AI summary — shape varies by insight type. ## Limits and defaults | Tool | Default limit | Max limit | | --------------- | ------------- | --------- | | `list_signals` | 50 | 200 | | `list_issues` | 25 | 200 | | `list_insights` | 25 | 100 | | `get_issue` | — | — | | `update_issue` | — | — | If you need more than the max for a single tool call, filter by `status` (for `list_issues`) or fetch specific records individually. ## Scopes | Scope | Tools | | -------------- | --------------------------------------------------------------------------------------- | | `read:lucent` | `list_signals`, `list_issues`, `get_issue`, `list_insights`. Included with every token. | | `write:issues` | `update_issue`. | API keys get `write:issues` by checking **Allow issue status updates** at creation; keys without it can use the four read tools but `update_issue` returns a missing-scope error. OAuth clients must request `write:issues` explicitly — the default OAuth scope is `read:lucent`. ## Organization isolation Every tool call compiles to a SQL query with `WHERE org_id = ?` where `org_id` comes exclusively from the bearer token's auth context. No tool accepts an organization argument from the client, and `get_issue` compounds the ID check with the org check so an issue UUID from another organization will never resolve. If you need access to a different organization, sign in to that organization in the dashboard and mint a new token there. # Quickstart Source: https://docs.lucenthq.com/quickstart Record your first Lucent session in under five minutes. This guide walks you from zero to a recorded session in your dashboard. You'll need a Lucent account and about five minutes. ## 1. Create a public key Public keys begin with `luc_pk_` and are safe to embed in client‑side code — they can only write session data to your org and cannot read anything. Go to [app.lucenthq.com](https://app.lucenthq.com) and sign in. Navigate to **Settings → SDK keys** and create a new public key. Copy it somewhere safe — you'll paste it into your app next. ## 2. Run the CLI installer The fastest way to install Lucent is the framework‑aware CLI. It detects your package manager, installs `@lucenthq/sdk`, creates a provider file, and wires it into your root layout. ```bash theme={null} npx @lucenthq/cli init luc_pk_... ``` Pick your framework when prompted. The CLI supports Next.js, React (Vite/CRA), Vue, Angular, Svelte, Nuxt, Remix, Astro, Gatsby, and vanilla JavaScript — see the [CLI installer](/sdk/cli) page for the full list and what each one does. A few frameworks (Angular, Nuxt, Remix, Next.js Pages Router) need one final manual step the CLI can't safely automate. The CLI prints exactly what to do; framework pages have the full walkthrough. ## 3. Or install manually If you prefer to wire things up by hand, or your framework isn't in the CLI's list, install the package and follow one of the framework pages: ```bash npm theme={null} npm install @lucenthq/sdk ``` ```bash pnpm theme={null} pnpm add @lucenthq/sdk ``` ```bash yarn theme={null} yarn add @lucenthq/sdk ``` ```bash bun theme={null} bun add @lucenthq/sdk ``` Pick your framework: ## 4. Identify your users (optional) Attach a user identity so sessions are grouped by the right person in the dashboard. Until you call `identify`, sessions are tied to a generated anonymous ID stored in `localStorage`. ```tsx theme={null} import { LucentProvider, LucentIdentify } from "@lucenthq/sdk/react"; {children} ``` ```ts theme={null} tracker.identify({ id: "user_123", email: "jane@example.com", name: "Jane Doe", }); ``` ### Send feature flags for Signals If you use Lucent SDK for session replay and your feature flags come from LaunchDarkly, Statsig, GrowthBook, a homegrown service, or another provider, send the evaluated flag values as user properties. Signals can then filter SDK sessions by those observed values without a PostHog, Datadog, or Amplitude integration. ```tsx theme={null} ``` ```ts theme={null} tracker.identify({ id: "user_123", email: "jane@example.com", properties: { featureFlags: { "new-checkout-flow": launchDarkly.variation("new-checkout-flow"), "pricing-page-redesign": statsig.checkGate("pricing-page-redesign"), "paywall-test": growthbook.getFeatureValue("paywall-test", "control"), }, }, }); ``` Use the same flag key in Lucent's Signal filter. For example, `new-checkout-flow = variant-a` matches SDK sessions where `featureFlags["new-checkout-flow"]` was recorded as `variant-a`. Lucent evaluates the feature flag values stored on the session. Call `identify` again if a flag value changes during the session. ## 5. Verify the session 1. Run your app and navigate through a few pages. 2. Open [app.lucenthq.com](https://app.lucenthq.com) → **Sessions**. 3. Your session should appear within a few seconds of its first event — Lucent flushes batches every 10 seconds by default and immediately on page unload. ## Next steps Per‑framework breakdown of what `npx @lucenthq/cli init` does. Tune privacy, sampling, capture, and batching. Give Lucent project-specific context about your product and users. Control which sessions Lucent processes for each project. `LucentProvider`, `LucentIdentify`, and `useLucent`. The ingest endpoints that power the SDK. # CLI installer Source: https://docs.lucenthq.com/sdk/cli One command to install @lucenthq/sdk and wire it into your framework. `@lucenthq/cli` is a zero‑config installer for the Lucent browser SDK. Run it once, pick your framework, and the CLI writes the provider file, adds the environment variable, and wraps your app tree so recording starts on the next page load. ```bash theme={null} npx @lucenthq/cli init luc_pk_... ``` ## What the CLI does 1. **Validates your public key** against the Lucent ingest API. 2. **Prompts for your framework** and (where relevant) a sub‑variant like App Router vs Pages Router, or Vite vs Create React App. 3. **Detects your package manager** (`npm`, `yarn`, `pnpm`) and installs `@lucenthq/sdk`. 4. **Writes an environment variable** into the right `.env` file for your framework (`NEXT_PUBLIC_LUCENT_PUBLIC_KEY`, `VITE_LUCENT_PUBLIC_KEY`, etc.). 5. **Creates a provider or service file** (`app/providers.tsx`, `src/lib/lucent.ts`, `lucent.service.ts`, …). 6. **Modifies your root file** to wire the provider into your app tree. If any step is unsafe to automate — your root file has a shape the CLI can't recognize, or the target file is missing — the CLI prints exact manual instructions and keeps going. ## Supported frameworks App Router and Pages Router. Vite and Create React App. Vue 3 with Vite. Standalone (17+) and NgModule. SvelteKit and plain Svelte. Nuxt 3. Remix v2. Astro with Layout components. Gatsby v5. Plain JavaScript, any bundler. ## Flags Print every action the CLI would take without touching the filesystem or installing any packages. Useful for previewing changes in a clean repo. ## What the CLI fully automates vs what it scaffolds Not every framework can be wired up without human judgment. The table below is the honest truth about what `npx @lucenthq/cli init` does for each framework. When a framework is marked **scaffold + manual step**, the CLI still writes the provider file and env var — it just prints one final step you need to do by hand. Every framework page in this section shows exactly what that step is. | Framework | Category | Final step | | -------------------- | ---------------------- | ------------------------------------------------------------------- | | Next.js App Router | Fully automatic | — | | React (Vite) | Fully automatic | — | | React (CRA) | Fully automatic | — | | Vue | Fully automatic | — | | SvelteKit | Fully automatic | — | | Svelte (plain) | Fully automatic | — | | Astro | Fully automatic | — | | Gatsby | Fully automatic | — | | Next.js Pages Router | Scaffold + manual step | Wrap `` with `` in `pages/_app.tsx` | | Angular (Standalone) | Scaffold + manual step | Inject `LucentService` in `AppComponent` so DI instantiates it | | Angular (NgModule) | Scaffold + manual step | Inject `LucentService` in `AppComponent` so DI instantiates it | | Nuxt | Scaffold + manual step | Add `lucentPublicKey` to `runtimeConfig.public` in `nuxt.config.ts` | | Remix | Scaffold + manual step | Expose `LUCENT_PUBLIC_KEY` via a loader | | Vanilla JS | Scaffold only | Add the script tag and bundle the init file yourself | The "fully automatic" list is verified by running the CLI against real starter files for each framework and checking that the output compiles. If you hit a case the CLI can't handle — e.g. a customized `layout.tsx` with a non‑standard structure — the CLI falls back to manual instructions instead of producing broken code. ## Troubleshooting Either the key is wrong, has been revoked in the dashboard, or belongs to a different org. Get a fresh key at **Settings → SDK keys** in [app.lucenthq.com](https://app.lucenthq.com). The CLI validates your key against the ingest API before touching your project. Check your network connection and retry. If you're behind a corporate proxy, you may need to configure `HTTPS_PROXY`. The CLI skips files that already contain the word "lucent" or reference `@lucenthq/sdk`. This is intentional — rerunning the CLI won't clobber an existing setup. If you want to re‑apply the template, remove the Lucent references by hand first. Use the [vanilla JS](/sdk/frameworks/vanilla) instructions — they work with any bundler. If you'd like first‑class support for your framework, [open an issue](https://github.com/lucent-ai/mono-lucent/issues). # Configuration Source: https://docs.lucenthq.com/sdk/configuration Full reference for LucentInitOptions. Every option the browser SDK accepts, with its default value and a note on when to change it. These apply to both `new LucentTracker(options)` and the `options` prop on ``. ```ts theme={null} import { LucentTracker } from "@lucenthq/sdk"; const tracker = new LucentTracker({ publicKey: "luc_pk_...", privacy: { mode: "privacy-first" }, sampling: { sessionReplay: 1.0 }, capture: { canvas: false, console: true, network: true, }, }); ``` ## Core Your Lucent publishable key (`luc_pk_...`). Safe to expose in client‑side code — can only write session data to your org, cannot read anything. Manage keys in the [dashboard](https://app.lucenthq.com). Override the ingest endpoint. Only needed for self‑hosted setups or internal testing. When `false`, the `` will not begin recording until you explicitly call `start()`. Useful when you want to wait for user consent before collecting data. Currently honored by `` only — `new LucentTracker(...)` always starts immediately. ## Privacy Lucent ships with a **privacy‑first default**: all text content is masked and all inputs are redacted unless you opt in. * `privacy-first` — mask all text and inputs by default. Add the `data-lucent-unredact` attribute to any element whose text you want to record. * `visibility-first` — record text by default. Use `redactSelectors` to opt specific elements out. CSS selectors whose matched elements should have their text replaced with asterisks. Commonly used for PII like email, name, address. When `true`, all form inputs (except `` and ``) have their values replaced. Defaults to `true` in `privacy-first` mode and `false` in `visibility-first` mode. CSS selectors whose matched elements should be replaced with a placeholder rectangle in the replay. Use for third‑party widgets you cannot safely record. ## Capture Toggle individual data sources on or off. Clicks, inputs, and form submissions are always captured — they're required for the replay and for rage‑click / dead‑click detection. Record `` contents. Disabled by default because it is bandwidth‑heavy. Capture `console.log` / `warn` / `error` output from the page. Which console levels to record. Tighten this to `["warn", "error"]` if you want to reduce noise. Capture `fetch` and `XMLHttpRequest` calls (method, URL, status, timing). Request/response bodies are **not** captured. Network requests matching any of these patterns are skipped entirely. Useful for filtering out noisy analytics or telemetry endpoints. ## Sampling Fraction of sessions to record, between `0.0` and `1.0`. The decision is made once per `LucentTracker` instance on construction — not per event. For example, `0.1` records 10% of sessions. ## Batching These defaults match what the ingest API is tuned for. Change them only if you have a specific reason. How often the event queue is flushed to the ingest API, in milliseconds. Maximum events per batch. Reaching this triggers an immediate flush. Maximum batch size in bytes (1 MiB). Reaching this triggers an immediate flush. ## Detection Thresholds for client‑side signal detection. Events that trip these fire `rage_click` and `dead_click` events into the session stream. Number of clicks on the same target within one second that counts as a rage click. If a click produces no DOM mutation or navigation within this many milliseconds, it's reported as a dead click. # Flutter SDK Source: https://docs.lucenthq.com/sdk/flutter Install lucent_flutter and capture mobile session replay, events, logs, network breadcrumbs, and errors. Lucent's first-party Flutter SDK is published as `lucent_flutter`. The MVP supports iOS and Android. Flutter Web is deferred because Flutter Web needs a separate web capture path, while this SDK sends screenshot-mode mobile replay. ## Requirements * Flutter `>=3.27.0` * Dart `>=3.6.0` * iOS `13.0` or later * Android min SDK `23` or later * A Lucent public key (`luc_pk_...`) ## Install `lucent_flutter` is not published on pub.dev yet. Until `0.1.0` is published, install it from the Lucent monorepo or from a local SDK checkout. ```yaml Git theme={null} dependencies: lucent_flutter: git: url: https://github.com/lucent-ai/mono-lucent.git path: sdk-flutter-lucent ref: ``` ```yaml Local theme={null} dependencies: lucent_flutter: path: ../mono-lucent/sdk-flutter-lucent ``` After the package is published to pub.dev, use the normal hosted package dependency: ```yaml theme={null} dependencies: lucent_flutter: ^0.1.0 ``` Then fetch dependencies: ```bash theme={null} flutter pub get ``` For iOS, use the standard Flutter CocoaPods flow: ```bash theme={null} cd ios pod install ``` For Android release builds, make sure your app manifest allows network access. Flutter debug and profile builds may add this automatically, but release apps should include it explicitly in `android/app/src/main/AndroidManifest.xml`. ```xml theme={null} ``` CocoaPods is the verified iOS packaging path for the MVP. Swift Package Manager support is deferred because Flutter can generate a package identity from the local SDK directory that differs from the pub package name. ## Quick start Set up Lucent before `runApp`, then wrap your app in `LucentWidget`. ```dart theme={null} import 'package:flutter/material.dart'; import 'package:lucent_flutter/lucent_flutter.dart'; Future main() async { WidgetsFlutterBinding.ensureInitialized(); await Lucent().setup( const LucentConfig( publicKey: 'luc_pk_...', metadata: LucentMetadataConfig( app: 'Acme Mobile', namespace: 'com.acme.mobile', version: '1.2.3', build: '123', release: '1.2.3+123', ), ), ); Lucent().runZoned(() { runApp(const LucentWidget(child: MyApp())); }); } ``` `LucentWidget` captures screenshot-mode replay, touch events, and app lifecycle events. Keep it near the root of the app so remounts do not reset the replay surface. ## Screen tracking Add `LucentObserver()` to your `MaterialApp` navigator observers to emit `$screen` events and update the replay URL. ```dart theme={null} MaterialApp( navigatorObservers: [LucentObserver()], routes: { '/': (_) => const HomeScreen(), '/checkout': (_) => const CheckoutScreen(), }, ) ``` If your router does not use named `PageRoute`s, call `Lucent().screen(...)` from your route listener. ```dart theme={null} await Lucent().screen('checkout', {'step': 'payment'}); ``` You can also customize the observer for apps that need custom route names or route filtering. ```dart theme={null} LucentObserver( nameExtractor: (settings) => settings.name ?? 'unknown', routeFilter: (route) => route is PageRoute, ) ``` ## Identify users Sessions start with a generated anonymous ID. Call `identify` when you know the user, and call `resetIdentity` on sign out. ```dart theme={null} await Lucent().identify( const LucentUser( id: 'user_123', email: 'ada@example.com', name: 'Ada Lovelace', properties: {'plan': 'pro'}, ), ); await Lucent().setUserProperties({'role': 'admin'}); await Lucent().setSessionProperties({'checkoutExperiment': 'variant_a'}); await Lucent().resetIdentity(); ``` ## Track events Use `track` for custom events. Event properties also receive metadata from `LucentMetadataConfig`. ```dart theme={null} await Lucent().track('checkout_tapped', { 'plan': 'pro', 'source': 'pricing', }); ``` ## Control recording Replay starts automatically by default when the session is sampled in. You can pause, resume, flush, and inspect the current session. ```dart theme={null} await Lucent().stopSessionRecording(); await Lucent().startSessionRecording(resumeCurrent: true); await Lucent().flush(); await Lucent().flush(finalFlush: true); final info = await Lucent().getSessionInfo(); debugPrint(info?.sessionId); ``` Call `Lucent().stop()` when you need to tear down the SDK. It stops native recording, clears installed Dart hooks, and performs a final native flush. Use `autoStart: false` or `LucentReplayConfig.eventTriggers` when you need to wait for consent or only record after specific events. ```dart theme={null} await Lucent().setup( const LucentConfig( publicKey: 'luc_pk_...', autoStart: false, replay: LucentReplayConfig( eventTriggers: ['checkout_tapped'], ), ), ); ``` ## Privacy masking Flutter replay is privacy-first. Text, text inputs, and images are masked by default. Wrap extra-sensitive regions in `LucentMask`, and wrap safe public regions in `LucentNoMask`. ```dart theme={null} const LucentMask( child: PaymentCardForm(), ); const LucentNoMask( child: Text('Public status: ready'), ); ``` `LucentNoMask` opts the subtree into replay visibility, so only use it for UI that is safe to show in a session replay. ## Logs When `capture.logs` is enabled, Lucent captures Flutter `debugPrint` output. Wrapping `runApp` in `Lucent().runZoned(...)` also captures `print(...)`. ```dart theme={null} Lucent().runZoned(() { print('App started'); runApp(const LucentWidget(child: MyApp())); }); await Lucent().captureLog( 'Checkout validation failed', level: 'warn', properties: {'field': 'zip'}, ); ``` ## Network breadcrumbs When `capture.network` is enabled, `Lucent().runZoned(...)` installs a zone-scoped `dart:io` `HttpClient` wrapper. It captures method, sanitized URL, status, duration, and transfer size for requests made inside the zone. ```dart theme={null} Lucent().runZoned(() { runApp(const LucentWidget(child: MyApp())); }); ``` For clients that do not use `dart:io`, call `captureNetworkRequest` from your HTTP wrapper or interceptor. ```dart theme={null} final response = await Lucent().captureNetworkRequest( method: 'GET', url: 'https://api.example.com/products?token=secret', request: () => client.get('/products'), status: (response) => response.statusCode, transferSize: (response) => response.bodyBytes.length, ); ``` You can also send a manual network breadcrumb. ```dart theme={null} await Lucent().captureNetwork( method: 'POST', url: 'https://api.example.com/checkout', status: 200, durationMs: 184, ); ``` Lucent strips URL user info, query strings, and fragments before upload. Request bodies, response bodies, and headers are not captured. ## Errors and crashes Lucent captures Flutter framework errors and `PlatformDispatcher` async errors when the corresponding capture options are enabled. Use `captureException` for handled exceptions and `addExceptionStep` for lightweight breadcrumbs. ```dart theme={null} try { await checkout(); } catch (error, stackTrace) { await Lucent().addExceptionStep('Checkout failed after payment tap'); await Lucent().captureException(error, stackTrace: stackTrace); rethrow; } ``` Native uncaught exceptions are stored synchronously and emitted as `$native_crash` on the next launch. If your app already has a top-level async error handler, pass it to `runZoned`. ```dart theme={null} Lucent().runZoned( () => runApp(const LucentWidget(child: MyApp())), onError: (error, stackTrace) { // Forward to your existing crash reporter. }, ); ``` ## Example app The SDK package includes an example app that exercises setup, `LucentWidget`, `LucentObserver`, masking, custom events, manual network breadcrumbs, handled exceptions, and flush. ```bash theme={null} cd sdk-flutter-lucent/example flutter pub get flutter run ``` ## Next steps * [Flutter support reference](/sdk/flutter-reference) - options, replay envelope, persistence, limitations, and troubleshooting. * [Replay endpoint](/api-reference/endpoint/replay) - ingest payload schema. # Flutter support reference Source: https://docs.lucenthq.com/sdk/flutter-reference Reference for lucent_flutter configuration, replay behavior, persistence, and known limitations. Use this page when you need the exact Flutter SDK behavior and option surface. For setup instructions, start with the [Flutter SDK guide](/sdk/flutter). ## Support matrix | Area | Flutter SDK behavior | | ---------------------- | ----------------------------------------------------------------------------------------- | | Package | `lucent_flutter` | | Supported platforms | iOS and Android | | Deferred platforms | Flutter Web and macOS are not in the MVP | | Replay mode | Screenshot-mode mobile replay | | Backend classification | `lucent-flutter` maps to `mobile_flutter` | | iOS packaging | CocoaPods is verified | | Android packaging | Flutter plugin with Android min SDK `23`; release apps need `android.permission.INTERNET` | | Example app | `sdk-flutter-lucent/example` in the SDK repo | ## Replay envelope Flutter replay is always sent as mobile screenshot replay: ```json theme={null} { "snapshotSource": "mobile", "snapshotLibrary": "lucent-flutter", "snapshotMode": "screenshot" } ``` The SDK captures a masked `RepaintBoundary` image from `LucentWidget`, encodes it as a mobile screenshot wireframe, and posts batches to `/api/sdk/replay`. The backend classifies these sessions as `mobile_flutter`. ## Persistence and retry Replay batches are persisted on disk before upload on iOS and Android. Failed uploads remain queued for retry. | Limit | Value | | -------------------------- | -------- | | Maximum queued batch files | `100` | | Maximum queued bytes | `50 MB` | | Maximum queued age | `7 days` | Android also persists current in-memory replay events between flushes, so active events can survive a process restart before they become an upload batch. `flush()` is best effort. If the network request fails, the persisted batch stays queued and is retried later. When `LucentWidget` sees the app pause or become inactive, it emits `Application Backgrounded` and requests a flush. When the app resumes, it emits `Application Became Active`. ## Configuration Pass `LucentConfig` to `Lucent().setup(...)`. ```dart theme={null} await Lucent().setup( const LucentConfig( publicKey: 'luc_pk_...', ingestBaseUrl: 'https://ingest-api.lucenthq.com', environment: LucentEnvironment.production, autoStart: true, remoteConfig: true, sessionReplaySampleRate: 1, privacy: LucentPrivacyConfig( maskAllText: true, maskAllImages: true, ), capture: LucentCaptureConfig( touches: true, appLifecycle: true, errors: true, unhandledRejections: true, nativeCrashes: true, logs: true, network: true, ), batching: LucentBatchingConfig( flushInterval: Duration(seconds: 10), maxEventsPerBatch: 500, maxBatchBytes: 1048576, ), replay: LucentReplayConfig( minimumDuration: Duration.zero, screenshotThrottle: Duration(seconds: 1), screenshotBackgroundCapture: false, eventTriggers: [], ), metadata: LucentMetadataConfig( app: 'Acme Mobile', namespace: 'com.acme.mobile', version: '1.2.3', build: '123', release: '1.2.3+123', properties: {'tier': 'pro'}, ), ), ); ``` ### Core | Option | Default | Notes | | ------------------------- | --------------------------------- | ---------------------------------------------------------- | | `publicKey` | Required | Your Lucent public key. Safe to expose in client code. | | `ingestBaseUrl` | `https://ingest-api.lucenthq.com` | Override only for self-hosted or internal testing. | | `environment` | `LucentEnvironment.production` | Use `staging` or `development` for non-production apps. | | `autoStart` | `true` | Set to `false` when you need to wait for consent. | | `remoteConfig` | `true` | Fetches `/api/sdk/init` before auto-starting when enabled. | | `sessionReplaySampleRate` | `1` | Clamped between `0` and `1`. | When `remoteConfig` is enabled, native replay waits for `/api/sdk/init` before auto-starting. If the request fails, the SDK falls back to local config. Remote config can disable recording, override session sample rate, update batching limits, change `minimumDuration`, toggle log/network telemetry, and replace `eventTriggers`. ### Privacy | Option | Default | Notes | | ----------------------- | ------- | --------------------------------------------------------------- | | `privacy.maskAllText` | `true` | Masks `Text`, `RichText`, and editable text widgets by default. | | `privacy.maskAllImages` | `true` | Masks rendered image widgets by default. | `LucentMask` forces masking for a subtree. `LucentNoMask` makes its subtree visible, so keep sensitive widgets outside any `LucentNoMask` region. Flutter does not have browser-style CSS selectors. Review any `LucentNoMask` subtree carefully before shipping. ### Capture | Option | Default | Captures | | ----------------------------- | ------- | ---------------------------------------------------------------------------------- | | `capture.touches` | `true` | Pointer-down coordinates and `$touch` events. | | `capture.appLifecycle` | `true` | `Application Opened`, `Application Became Active`, and `Application Backgrounded`. | | `capture.errors` | `true` | Flutter framework errors. | | `capture.unhandledRejections` | `true` | `PlatformDispatcher` async errors. | | `capture.nativeCrashes` | `true` | Native uncaught exceptions on next launch. | | `capture.logs` | `true` | `debugPrint`, `print` inside `runZoned`, and manual logs. | | `capture.network` | `true` | `dart:io` network breadcrumbs inside `runZoned` and manual network breadcrumbs. | ### Batching | Option | Default | Notes | | ---------------------------- | ------------ | ------------------------------- | | `batching.flushInterval` | `10 seconds` | Native flush loop interval. | | `batching.maxEventsPerBatch` | `500` | Reaching this triggers a flush. | | `batching.maxBatchBytes` | `1048576` | Reaching this triggers a flush. | Native code clamps flush interval, event count, and byte limits to bounded ranges so misconfiguration does not create extremely small or huge batches. ### Replay | Option | Default | Notes | | ------------------------------------ | --------------- | ---------------------------------------------------------------- | | `replay.minimumDuration` | `Duration.zero` | Final flushes shorter than this are dropped. | | `replay.screenshotThrottle` | `1 second` | How often `LucentWidget` attempts a screenshot. | | `replay.screenshotBackgroundCapture` | `false` | Screenshots stop while the app is backgrounded by default. | | `replay.eventTriggers` | `[]` | When set, recording starts after one of these events is tracked. | `snapshotMode` is not configurable. It is always `screenshot`. ### Metadata and properties | Option | Event property | | --------------------- | -------------------------- | | `metadata.app` | `$app_name` | | `metadata.namespace` | `$app_namespace` | | `metadata.version` | `$app_version` | | `metadata.build` | `$app_build` | | `metadata.release` | `release` | | `metadata.properties` | Merged into event metadata | Use `Lucent().setSessionProperties(...)` and `Lucent().setUserProperties(...)` when values change during a session. The native payload also includes common mobile context: `userAgent`, `language`, `snapshotSource`, `snapshotLibrary`, `snapshotMode`, `os`, `deviceType`, and `environment`. ## Public API | Method | Use for | | ------------------------------------------------------------ | ------------------------------------------------------------------------------ | | `Lucent().setup(config)` | Initialize the SDK and native modules. | | `Lucent().stop()` | Stop native recording, uninstall Dart hooks, and perform a final native flush. | | `Lucent().track(name, properties?)` | Capture a custom event. | | `Lucent().identify(user)` | Associate future events with a known user. | | `Lucent().resetIdentity()` | Clear the known user and generate a new anonymous ID. | | `Lucent().screen(name, properties?)` | Emit `$screen` and update replay screen context. | | `Lucent().setSessionProperties(properties)` | Attach session-level properties. | | `Lucent().setUserProperties(properties)` | Attach user-level properties. | | `Lucent().captureLog(message, level, properties)` | Capture a manual log breadcrumb. | | `Lucent().captureNetwork(...)` | Capture a manual network breadcrumb. | | `Lucent().captureNetworkRequest(...)` | Wrap an async request and capture timing/status. | | `Lucent().captureException(error, stackTrace?, properties?)` | Capture a handled exception. | | `Lucent().addExceptionStep(message, properties?)` | Add an exception breadcrumb. | | `Lucent().startSessionRecording(resumeCurrent: true)` | Resume screenshot replay. | | `Lucent().stopSessionRecording()` | Pause screenshot replay and final flush. | | `Lucent().isSessionReplayActive()` | Check whether replay is currently active. | | `Lucent().flush(finalFlush: false)` | Flush queued events. Set `finalFlush: true` for a final flush. | | `Lucent().getSessionInfo()` | Read `sessionId`, `windowId`, and recording state. | | `Lucent().runZoned(body, onError?)` | Capture `print`, async errors, and `dart:io` network inside a zone. | `getSessionInfo()` returns `sessionId`, `windowId`, and `recordingEnabled`. Use `runZoned(..., onError: handler)` if your app already has its own top-level async error handler. ## Navigation reference `LucentObserver` accepts two optional callbacks: | Callback | Use for | | --------------------------------------- | -------------------------------------------------------------------------- | | `nameExtractor(RouteSettings settings)` | Convert route settings into a screen name. Defaults to `settings.name`. | | `routeFilter(Route? route)` | Decide which routes should emit screens. Defaults to `route is PageRoute`. | For routers that do not expose named `PageRoute`s, call `Lucent().screen(...)` from your router listener instead. ## Network privacy Automatic network capture is limited to `dart:io` `HttpClient` traffic created inside `Lucent().runZoned(...)`. Other HTTP clients need a wrapper or interceptor that calls `captureNetworkRequest` or `captureNetwork`. Lucent captures: | Field | Captured | | ---------------------------------- | ------------------- | | HTTP method | Yes | | URL origin and path | Yes | | URL user info, query, and fragment | No | | Status code | Yes, when available | | Duration | Yes, when available | | Transfer size | Yes, when available | | Request headers | No | | Response headers | No | | Request body | No | | Response body | No | Because headers and bodies are not captured, there are no per-field masking rules for them. Sanitize URLs before manual capture if a path segment contains sensitive data. ## Error and crash behavior | Error source | Behavior | | -------------------------- | ----------------------------------------------------------------------------------------------------- | | Flutter framework errors | Captured through `FlutterError.onError` when `capture.errors` is enabled. | | Async platform errors | Captured through `PlatformDispatcher.instance.onError` when `capture.unhandledRejections` is enabled. | | Handled exceptions | Capture manually with `Lucent().captureException(...)`. | | Native uncaught exceptions | Stored synchronously and emitted as `$native_crash` on the next launch. | Native crash delivery is best effort. If the process cannot write the pending crash payload before termination, there may be no next-launch crash event. ## Parity checklist | Capability | Flutter SDK | Notes | | --------------------------------- | ----------- | ----------------------------------------------------- | | iOS replay | Supported | Screenshot-mode mobile replay. | | Android replay | Supported | Screenshot-mode mobile replay. | | Flutter Web replay | Deferred | No web/canvas capture path in the MVP. | | Root replay wrapper | Supported | Use `LucentWidget`. | | Route tracking | Supported | Use `LucentObserver` or `Lucent().screen(...)`. | | Custom events | Supported | Use `Lucent().track(...)`. | | Identify/reset | Supported | Use `LucentUser` and `resetIdentity`. | | Touch capture | Supported | Pointer-down coordinate events. | | Privacy defaults | Supported | Text, inputs, and images mask by default. | | Logs | Supported | `debugPrint`, `print` in `runZoned`, and manual logs. | | Network breadcrumbs | Supported | `dart:io` in `runZoned` plus manual APIs. | | Handled errors | Supported | `captureException` and exception steps. | | Native crashes | Supported | Next-launch `$native_crash`, best effort. | | Persistent replay queue | Supported | iOS and Android batch queues with bounded retention. | | Android current-event persistence | Supported | Current events persist between flushes. | | Remote config | Supported | `/api/sdk/init` when enabled. | | Event-triggered replay | Supported | `LucentReplayConfig.eventTriggers`. | | CocoaPods | Supported | Verified iOS packaging path. | | Swift Package Manager | Deferred | Use CocoaPods for the MVP. | ## Not in the Flutter MVP These browser or React Native capabilities are not available in `lucent_flutter` 0.1.0: | Capability | Status | | ----------------------------------- | -------------------------------------------------------------------------------------------- | | Flutter Web replay | Deferred until a web/canvas capture path exists. | | CSS selector privacy rules | Not applicable to Flutter widget trees. Use `LucentMask` and `LucentNoMask`. | | `networkIgnoreUrls` | Not exposed. Sanitize URLs manually before manual capture if needed. | | Console level filtering | Not exposed. `debugPrint`, zoned `print`, and manual logs use the configured capture toggle. | | Rage-click and dead-click detection | Browser-only today. Flutter touch capture is coordinate-level. | | Alias/group APIs | Not in the Flutter MVP. | | Persistent super-property registry | Not in the Flutter MVP. Use metadata, session properties, and user properties. | | Source maps or native symbolication | External to the Flutter SDK docs today. | | Expo/Metro tooling | React Native only. | ## Troubleshooting | Symptom | Check | | ---------------------------------- | ------------------------------------------------------------------------------------------------------------------- | | No replay appears | Confirm `LucentWidget` wraps the app root and `sessionReplaySampleRate` is greater than `0`. | | No screen names | Add named routes, customize `LucentObserver`, or call `Lucent().screen(...)` manually. | | `print` logs are missing | Make sure `runApp` runs inside `Lucent().runZoned(...)`. | | Network calls are missing | Confirm the client uses `dart:io` inside `runZoned`, or add manual/interceptor capture. | | iOS build fails around pods | Run `flutter pub get`, then `cd ios && pod install`. | | iOS SPM warnings appear | Use CocoaPods for the MVP; Swift Package Manager support is deferred. | | A physical iOS device will not run | Enable Developer Mode and trust the development certificate/device pairing. | | Android release uploads fail | Add `` to `android/app/src/main/AndroidManifest.xml`. | | Android device install fails | Confirm USB debugging is enabled and the device trusts the development machine. | | Replay is too sparse | Lower `replay.screenshotThrottle`, but watch bandwidth and battery use. | # Angular Source: https://docs.lucenthq.com/sdk/frameworks/angular Install Lucent in an Angular app. Supports both Standalone (17+) and NgModule. **Scaffold + manual step.** The CLI writes the environment file and `LucentService`, but Angular's DI is lazy — the service won't run until something injects it. You must add a one‑line constructor inject in `AppComponent` after the CLI finishes. ## Install with the CLI ```bash theme={null} npx @lucenthq/cli init luc_pk_... ``` Pick **Angular** when prompted, then choose your style. ## Standalone (Angular 17+) `src/environments/environment.ts`: ```ts theme={null} export const environment = { lucentPublicKey: "luc_pk_..." }; ``` `src/app/lucent.service.ts`: ```ts theme={null} import { Injectable, OnDestroy } from "@angular/core"; import { LucentTracker } from "@lucenthq/sdk"; import { environment } from "../environments/environment"; @Injectable({ providedIn: "root" }) export class LucentService implements OnDestroy { private tracker: LucentTracker; constructor() { this.tracker = new LucentTracker({ publicKey: environment.lucentPublicKey, }); this.tracker.start(); } ngOnDestroy() { this.tracker.stop(); } } ``` Angular's DI is lazy. The service won't start until something injects it. Add this one line to `src/app/app.component.ts`: ```ts theme={null} import { Component } from "@angular/core"; import { LucentService } from "./lucent.service"; @Component({ /* ... */ }) export class AppComponent { constructor(private lucent: LucentService) {} } ``` ## NgModule (pre‑17) The setup is identical to Standalone — same environment file, same `LucentService`, same one‑line inject in `AppComponent`. The only difference is which file you inject from. ```ts theme={null} // src/app/app.component.ts import { Component } from "@angular/core"; import { LucentService } from "./lucent.service"; @Component({ /* ... */ }) export class AppComponent { constructor(private lucent: LucentService) {} } ``` ## Notes * `providedIn: "root"` alone isn't enough. Angular tree‑shakes services that are never injected anywhere, so you **must** reference `LucentService` from at least one component constructor. * `ngOnDestroy` flushes any buffered events before the tracker shuts down. * If you already use `APP_INITIALIZER` for bootstrap‑time side effects, you can wire `LucentService` into it instead of relying on `AppComponent` construction. The CLI doesn't do this automatically because it requires reading your existing provider configuration. # Astro Source: https://docs.lucenthq.com/sdk/frameworks/astro Install Lucent in an Astro site via a Layout component. **Fully automated.** The CLI creates a `LucentInit.astro` component and wires it into your main layout. ## Install with the CLI ```bash theme={null} npx @lucenthq/cli init luc_pk_... ``` Pick **Astro** when prompted. ## Manual setup `.env`: ```bash theme={null} PUBLIC_LUCENT_PUBLIC_KEY=luc_pk_... ``` `src/components/LucentInit.astro`: ```astro theme={null} ``` `src/layouts/Layout.astro`: ```astro theme={null} --- import LucentInit from "../components/LucentInit.astro"; --- ``` ## Notes * Astro runs ` ``` ## Plain Svelte `.env`: ```bash theme={null} VITE_LUCENT_PUBLIC_KEY=luc_pk_... ``` `src/lib/lucent.ts`: ```ts theme={null} import { LucentTracker } from "@lucenthq/sdk"; let tracker: LucentTracker | null = null; export function initLucent() { if (!tracker) { tracker = new LucentTracker({ publicKey: import.meta.env.VITE_LUCENT_PUBLIC_KEY, }); tracker.start(); } return tracker; } ``` `src/App.svelte`: ```svelte theme={null} ``` ## Notes * SvelteKit uses `$env/static/public` for publicly‑accessible env vars that need the `PUBLIC_` prefix. Plain Svelte uses the Vite `VITE_` prefix. * `onMount` ensures the tracker only initializes in the browser — the init module is safe to import during SSR, but calling `initLucent()` at the module top level would crash on the server. # Vanilla JavaScript Source: https://docs.lucenthq.com/sdk/frameworks/vanilla Install Lucent in any app that can import an npm package. **Scaffold only.** The CLI writes a starter file with a placeholder; you still need to add the script tag (or import it from your bundler entry point) yourself. ## Install with the CLI ```bash theme={null} npx @lucenthq/cli init luc_pk_... ``` Pick **Vanilla JavaScript** when prompted. ## Manual setup ```bash theme={null} npm install @lucenthq/sdk ``` `lucent-init.js`: ```js theme={null} import { LucentTracker } from "@lucenthq/sdk"; const tracker = new LucentTracker({ publicKey: "luc_pk_...", }); tracker.start(); ``` If you're using a bundler (Vite, Webpack, esbuild, Parcel…), import the file from your main entry point so it runs once when the page loads: ```js theme={null} import "./lucent-init.js"; ``` ## Loading without a bundler If you don't use a bundler, load the SDK from a CDN with an ESM ` ``` The CDN form is convenient for quick tests but adds a round‑trip on first page load. For production use, bundle `@lucenthq/sdk` into your app. ## Notes * Replace `"luc_pk_..."` with a real key. Reading it from an env var is your bundler's job — e.g. `process.env.LUCENT_PUBLIC_KEY` with Webpack's `DefinePlugin`, or `import.meta.env.VITE_LUCENT_PUBLIC_KEY` with Vite. * For TypeScript projects, `@lucenthq/sdk` ships its own types — no `@types/*` package needed. * If you're using React, Vue, Svelte, or one of the other supported frameworks, use the dedicated framework page instead of this one. # Vue Source: https://docs.lucenthq.com/sdk/frameworks/vue Install Lucent in a Vue 3 + Vite application. **Fully automated.** The CLI writes a composable and calls it in `main.ts`. ## Install with the CLI ```bash theme={null} npx @lucenthq/cli init luc_pk_... ``` Pick **Vue** when prompted. ## Manual setup `.env`: ```bash theme={null} VITE_LUCENT_PUBLIC_KEY=luc_pk_... ``` `src/composables/useLucent.ts`: ```ts theme={null} import { LucentTracker } from "@lucenthq/sdk"; let tracker: LucentTracker | null = null; export function useLucent() { if (!tracker) { tracker = new LucentTracker({ publicKey: import.meta.env.VITE_LUCENT_PUBLIC_KEY, }); tracker.start(); } return tracker; } ``` `src/main.ts`: ```ts theme={null} import { createApp } from "vue"; import App from "./App.vue"; import { useLucent } from "./composables/useLucent"; useLucent(); createApp(App).mount("#app"); ``` ## Notes * Vue doesn't need a provider because tracking is handled by the `LucentTracker` instance directly — the composable just guarantees a single instance. * To access the tracker from a component, import `useLucent` and call it — it returns the same singleton each time. # Installation Source: https://docs.lucenthq.com/sdk/installation Install @lucenthq/sdk and wire it into your app. The Lucent browser SDK is published to npm as [`@lucenthq/sdk`](https://www.npmjs.com/package/@lucenthq/sdk). It ships both ESM and CommonJS builds and has a single runtime dependency on [rrweb](https://www.rrweb.io/). React bindings are exposed under `@lucenthq/sdk/react` and are only loaded if you import them. ## Recommended: the CLI installer The fastest way to install Lucent is the framework‑aware CLI. It picks the right provider shape, env var name, and entry file for your framework and wires everything up in one shot. ```bash theme={null} npx @lucenthq/cli init luc_pk_... ``` See the [CLI installer](/sdk/cli) page for what the CLI does, the full list of supported frameworks, and which ones require a final manual step. If the CLI can't figure out your project — or you just want to see the code before it lands in your repo — follow the manual instructions below. ## Requirements * A modern browser environment (evergreen Chrome, Safari, Firefox, Edge). * A Lucent public key — see the [Quickstart](/quickstart) for how to create one. * React 18 or 19 if you plan to use the React bindings (optional peer dependency). ## Manual install ```bash npm theme={null} npm install @lucenthq/sdk ``` ```bash pnpm theme={null} pnpm add @lucenthq/sdk ``` ```bash yarn theme={null} yarn add @lucenthq/sdk ``` ```bash bun theme={null} bun add @lucenthq/sdk ``` ## Entry points The package exposes two entry points: | Import | Use when | | --------------------- | ----------------------------------------------------------------------------------------- | | `@lucenthq/sdk` | You're using vanilla JavaScript/TypeScript, or you want direct access to `LucentTracker`. | | `@lucenthq/sdk/react` | You're building with React or Next.js and want the provider/hook API. | Both entry points resolve to the same underlying tracker. Importing the React entry does **not** pull in React unless React is already in your bundle — it declares React as an optional peer dependency. ## Minimal example ```ts theme={null} import { LucentTracker } from "@lucenthq/sdk"; const tracker = new LucentTracker({ publicKey: "luc_pk_...", }); tracker.start(); ``` ```tsx theme={null} "use client"; import { LucentProvider } from "@lucenthq/sdk/react"; export default function App({ children }: { children: React.ReactNode }) { return ( {children} ); } ``` ## Next steps * [CLI installer](/sdk/cli) — `npx @lucenthq/cli init` for every supported framework. * [Framework pages](/sdk/frameworks/nextjs) — step‑by‑step manual setup per framework. * [React integration](/sdk/react) — provider, identify, and hook APIs. * [Configuration](/sdk/configuration) — full options reference. # React API reference Source: https://docs.lucenthq.com/sdk/react Provider, identify component, and hook exposed by @lucenthq/sdk/react. The React entry point exposes three things: a **provider** that manages tracker lifecycle, a **renderless identify component** that syncs user identity, and a **hook** that returns the underlying tracker. ```ts theme={null} import { LucentProvider, LucentIdentify, useLucent } from "@lucenthq/sdk/react"; ``` ## LucentProvider Wraps your app, creates a single `LucentTracker` instance, and manages `start`/`stop` across the component lifetime. ```tsx theme={null} {children} ``` ### Props Your Lucent publishable key (`luc_pk_...`). Safe to expose in client‑side code — it can only write session data to your org and cannot read anything. Any option accepted by `LucentTracker` *except* `publicKey`. See the [Configuration](/sdk/configuration) page for the full list. Your application tree. ### Lifecycle The provider creates the tracker lazily on first render. On mount it calls `tracker.start()` (unless `options.autoStart === false`). On unmount it calls `tracker.stop()`, which flushes any buffered events. Do not remount `LucentProvider` on every render or route change — it should sit at the **root** of your app. Remounting will reset the recording session and cause gaps in your data. ## LucentIdentify A renderless component that calls `tracker.identify(...)` whenever its props change, and `tracker.resetIdentity()` when `userId` becomes null. Use it to sync your auth state with Lucent declaratively. ```tsx theme={null} {children} ``` ### Props Your internal user ID. When this transitions from a value to `null`, Lucent resets the identity and generates a new anonymous ID. Optional email address. Shown in the dashboard to help you find sessions. Optional display name. Arbitrary key/value pairs attached to the user. Useful for plan tier, signup date, feature flags, etc. ### Feature flags for Signals If your app records sessions with Lucent SDK and uses a separate feature flag provider, pass the evaluated flag values through `properties.featureFlags`. Signals can filter SDK sessions by these observed values. ```tsx theme={null} ``` Use the same flag key when creating a Signal filter. If a flag value changes during the session, update the `properties` object so `LucentIdentify` calls `identify` again. ## useLucent Returns the tracker instance from the nearest `LucentProvider`, or `null` if called outside a provider. Use this when you want to track custom events or manually flush. ```tsx theme={null} import { useLucent } from "@lucenthq/sdk/react"; export function CheckoutButton() { const lucent = useLucent(); return ( ); } ``` `useLucent` returns `null` during SSR and on the first render if the provider hasn't mounted yet. Always guard with `lucent?.` or a conditional before calling methods. For install steps, see [Next.js](/sdk/frameworks/nextjs) or [React](/sdk/frameworks/react). # React Native SDK Source: https://docs.lucenthq.com/sdk/react-native Install @lucenthq/react-native for screenshot-mode mobile session replay in React Native and Expo apps. The Lucent React Native SDK records mobile sessions with native screenshot-mode replay. Use it for React Native apps, Expo development builds, EAS builds, and Expo projects that have generated native iOS or Android projects. React Native replay is screenshot based. It does not use rrweb DOM or wireframe recording because React Native has no browser DOM. ## Setup difficulty | App type | Difficulty | What to expect | | --------------------------- | ---------- | --------------------------------------------------------------------------------------------------------------------------------------- | | Bare React Native | Easy | Install the package, run pods for iOS, and rebuild the app. | | Expo with dev-client or EAS | Easy | Install the package, generate or rebuild the native app, and run a development or production build. | | Expo Go-only | Medium | Expo Go cannot load Lucent's custom native modules. Move to a development build, EAS build, or prebuilt native project for full replay. | ## Install ```bash theme={null} npm install @lucenthq/react-native npx expo install expo-dev-client npx expo prebuild npx expo run:ios ``` Use `npx expo run:android` for Android, or build with EAS: ```bash theme={null} eas build --profile development --platform ios eas build --profile development --platform android ``` See [Expo setup](/sdk/react-native/expo) for the full Expo flow. ```bash theme={null} npm install @lucenthq/react-native npx pod-install ``` Then rebuild your native app: ```bash theme={null} npx react-native run-ios npx react-native run-android ``` ## Requirements * React 18 or newer. * React Native 0.71 or newer. * A Lucent public key from **Settings -> SDK keys** in the dashboard. * A native build environment for the platforms you ship. * Expo development builds, EAS builds, or prebuilt native projects for Expo apps. Expo Go can import the JavaScript package without crashing, but it cannot record full Lucent replay. Native screenshot replay, native crash capture, native network capture, and native log capture are disabled in Expo Go. ## Quickstart Wrap your app with `LucentProvider` near the root of the React tree. ```tsx theme={null} import { Button } from "react-native"; import { LucentIdentify, LucentProvider, useLucent, } from "@lucenthq/react-native"; export function App() { return ( ); } function CheckoutButton() { const lucent = useLucent(); return (