Integration recipes: Grafana, MoEngage, Retool, Segment device mode
Four ways to connect Lucida to tools you already run. Each one uses a public, documented surface; nothing here needs a custom build.
Four ways to connect Lucida to tools you already run. Each one uses a public, documented surface; nothing here needs a custom build.
Grafana
Lucida data in Grafana panels. Use the BI endpoint (the one behind the Looker Studio connector) with Grafana's Infinity data source:
Create a personal access token with read access to the project (Settings, API keys).
In Grafana add an Infinity data source. Base URL:
https://<your-lucida>/v1/projects/<project-id>/bi/tables. Add the headerAuthorization: Bearer <token>(Grafana keeps it as a secret).In a panel use type
JSON, sourceURL, formatTable, URL/web_overviewfor the totals,/web_channelfor a breakdown or/insight_<id>for any saved insight, and set rows/root selector torows. Columns come from theschemaarray of the same response.Large tables page: the response carries
next_cursor; pass it back as?cursor=(Infinity's pagination type "cursor", fieldnext_cursor, query parametercursor).?limit=is the page size (default 10000).?from=and?to=take ISO dates; map them to Grafana's${__from:date:YYYY-MM-DD}and${__to:date:YYYY-MM-DD}.
Lucida events on Grafana dashboards. Add the Grafana annotations destination (Connectors, Destinations). Settings: your Grafana URL (base_url). Credential: a service account token with annotations:write. Route the events you want to see (releases, flag changes, alert events) with a filter; each one becomes an annotation tagged lucida at the event time.
MoEngage
Add the MoEngage destination. Settings: workspace_id (also the Basic-auth user) and, for data centres other than 01, region (02 to 06). Credential: the Data API key from MoEngage under Settings, APIs. Events are sent as custom events (action = the event name, attributes = its properties, current_time in seconds); people are sent as customer attributes keyed by the distinct id. Use a route filter to send only the events your campaigns need, and a batched trigger to cap volume.
Retool
Retool talks to the same REST surface as everything else:
Create a REST API resource. Base URL
https://<your-lucida>/v1/projects/<project-id>; headerAuthorization: Bearer <personal access token>.For tables, a query against
GET /bi/tables/<table>?limit=1000returns{schema, rows, next_cursor}; transform with{{ data.rows.map(r => Object.fromEntries(r.map((v, i) => [data.schema[i].name, v]))) }}to feed a Table component. Follownext_cursorwith a second query or a JS loop for more.For actions use the write endpoints you already have scoped keys for, for example
POST /flags/<id>/togglewith{"enabled": true}behind a Retool confirmation modal. The token's role decides what works; a viewer token gets 404 on writes.To start a Retool Workflow from Lucida, create a Webhook destination pointing at the workflow trigger URL; or use the REST-hook triggers (
/v1/projects/<pid>/rest-hooks) to subscribe it to an event, cohort entry or alert.
Segment device mode
If your pages already load Segment's Analytics.js, register Lucida as a device-mode destination so Lucida's replay, autocapture and consent handling run in the same page and see the same visitor:
import { init } from "@lucida-analytics/browser";
import { lucidaDestination } from "@lucida/integration-segment-device";
const lucida = init("lc_pk_...", { apiHost: "https://lucida.example.com" });
await analytics.register(lucidaDestination(lucida));track becomes a Lucida event with the same name and properties, page a $pageview, screen a $screen, identify an identify (only once a userId exists), group a group call and alias a Lucida alias. Segment keeps its own consent categories: only register the plugin once the visitor has allowed analytics, or let Lucida's consent API (setConsent) gate it. For server-side Segment sources, use the Segment connector instead of device mode.