Add it when you need it

Analytics

Dashboards, cubes, fact tables and the drizzle-cube query API — everything that used to be part of the kit, now a repository of its own.

Installing it

zsh — your app
pnpm plugin add https://github.com/rocketflare-dev/rocketflare-plugins.git@analytics-v3.17.0 --subdir plugins/analyticspnpm plugin add https://github.com/rocketflare-dev/rocketflare-plugins.git@analytics-v3.17.0 --subdir plugins/analytics --apply
The first prints the plan and stops; the second writes it.

Then generate and run its migration — pnpm db:generate --name plugin-analytics-3.17.0 and pnpm db:migrate — and do the handful of steps the plan lists that a plugin may not do for you.

What it adds

  • Dashboards — one row per dashboard, stored whole as JSON, with a unique slug per organisation and the option to restrict it to a group. A list page, a view page with inline editing and autosave, and an explore page.
  • Templates — one ships, Organisation Overview, copied into every organisation when it is created and repaired lazily on every read, so a template added later still reaches the customers you already have.
  • Cubes — ActivityEvents, TenantActivityDaily, TenantUsers and Users, served at /cubejs-api. Every cube scopes its own query by organisation.
  • MCP tools — analytics_discover, analytics_validate and analytics_load, drizzle-cube's own tools offered read-only through the app's MCP server to Claude, ChatGPT and agent runs, with the reader's own scoping.
  • Fact tables — analytics_tenant_activity_daily_facts, rebuilt one organisation at a time by an hourly schedule, in one transaction each.
  • Permissions — a dashboard subject (admin and above manage, members read) and an analytics subject (every role reads; the query API is read-only by nature).
  • Commands — rocketflare analytics pages list, check-facts (exit 1 when a table is stale) and refresh-facts.
  • Four agent skills — analytics checks the plugin is healthy and routes; analytics-cubes adds measures, cubes and fact tables with the isolation test; analytics-queries queries the cubes and connects Claude or ChatGPT through the app's MCP server; analytics-dashboards builds, shares and templates dashboards.

Releases

  1. 3.17.0 2026-11-29

    Needs kit 0.50.0: the @nivo/heatmap alias moves from coreEdits into the manifest's dev block, and /cubejs-api is proxied in dev from apiPrefixes; plugin upgrade removes the lines older releases wrote into vite.config.ts. Porting note.

  2. 3.16.1 2026-11-28

    A test-only fix: the hourly fact-table cron test no longer rebuilds every tenant in a copy's shared test database, which had pushed other suites' setup hooks past their time limit. Porting note.

  3. 3.16.0 2026-11-28

    Analytics stops for an organisation that turned it off (kit 0.48.0's kill switch), and pnpm plugin check no longer warns about it. The plugin needs kit 0.48.0 or later. Porting note.

  4. 3.15.0 2026-11-28

    Analytics' cube tools answer egress and readsContent, so pnpm plugin check no longer warns about them, and the plugin needs kit 0.47.0 or later. Porting note.

  5. 3.14.0 2026-11-22

    Analytics imports react-router instead of react-router-dom, as the kit has since 0.25.0, so it no longer needs the host to keep react-router-dom installed (#40). Porting note.

21 older releases
  1. 3.13.3 2026-11-22

    No change to analytics: this release carries the global-search and connectors test changes, and every plugin in this repository ships at one version. Porting note.

  2. 3.13.2 2026-11-21

    The analytics manifest now carries a one-line description, which the kit's pnpm plugin list --available prints in place of the README's opening line. Porting note.

  3. 3.13.1 2026-11-21

    Analytics' agent guide names the removed db:refresh-facts and db:check-facts web scripts without a runnable pnpm command, so the kit's /rf-agent-docs check stops failing in every host that installs it. Porting note.

  4. 3.13.0 2026-11-20

    Analytics offers drizzle-cube's own MCP tools through the app's MCP server as analytics_discover, analytics_validate and analytics_load, and drops its own /mcp, which kit 0.41.0 owns. Porting note.

  5. 3.9.0 2026-11-09

    Analytics limits the activity cube to admins, caps batch size, sets a statement timeout and stops recording a creator on template pages. Porting note.

  6. 3.8.2 2026-11-08

    The analytics UI guide now says fact-table freshness is requested by admins only; no code changed. Porting note.

  7. 3.8.1 2026-11-03

    GET /api/analytics/facts/status reports only the caller's organisation. It used to read MAX() across every tenant, so an organisation's admin saw when any other organisation last had activity, and a busy tenant could hide another's stale fact table. Porting note.

  8. 3.8.0 2026-11-03

    analytics now compiles on React 19 with React Router 7 as well as on React 18 with Router 6, so a host can move to either. Imports stay on react-router-dom. drizzle-cube moves from 0.8.3 to 0.12.2, which declares React 19 and fixes a stored XSS in markdown portlets (GHSA-g3qv-p2w6-c95h). Porting note.

  9. 3.7.0 2026-10-24

    No change to analytics. This release exists because inbox splits forwarded-as-attachment email into messages of their own, and every plugin here ships at the repository's version. Porting note.

  10. 3.6.0 2026-10-24

    No change to analytics: this release exists because inbox and freeagent ship for the first time, and every plugin here ships at the repository's version. Porting note.

  11. 3.5.1 2026-10-22

    minKit rises from 0.13.0 to 0.17.1, because before kit 0.17.1 plugin check compares dependency ranges as strings and fails analytics as soon as react-grid-layout or react-is publishes a newer release inside the declared range. Porting note.

  12. 3.5.0 2026-10-22

    No change to analytics: this release exists because issue-reports ships for the first time, and every plugin here ships at the repository's version. Porting note.

  13. 3.4.2 2026-09-30

    The dashboard-visibility test's setup delete now names the tenant, so an app with analytics installed passes the kit's unscoped-allowlist scan. Porting note.

  14. 3.4.1 2026-09-27

    The cube API passes the request's database handle to drizzle-cube in a form that type-checks against kit 0.15.0, whose Database is driver-neutral; without it an app with analytics fails pnpm typecheck after taking that kit. Porting note.

  15. 3.4.0 2026-09-27

    Analytics now reads raw db.execute() results in a driver-neutral way, so it works on the kit's current postgres.js driver and on the Neon serverless driver the kit moves to in 0.15.0. Porting note.

  16. 3.3.0 2026-09-27

    Analytics now ships four Claude Code skills for drizzle-cube: analytics, analytics-cubes, analytics-queries and analytics-dashboards. Porting note.

  17. 3.2.0 2026-09-26

    No change to analytics: this release exists because the repository released connectors and m365 and every plugin here ships at the repository's version. Porting note.

  18. 3.1.0 2026-09-18

    No change to analytics: this release exists because the repository released web-knowledge and every plugin here ships at the repository's version. Porting note.

  19. 3.0.0 2026-09-18

    Compatibility is observed now, not declared: requires.kit and requires.pluginApi are gone, replaced by a top-level minKit of 0.8.0 and a derived uses block, so this release installs only into kit 0.8.0 or later. Porting note.

  20. 2.0.1 2026-09-18

    2.0.0 could not be installed with a green gate: its anchor still said 1.0.2, so every install reported a version mismatch against the recorded surface and exited 1, taking the whole host gate down with it. Porting note.

  21. 2.0.0 2026-09-18

    This plugin is written against the kit's plugin API now: it declares requires.pluginApi: "1", which moves it from *warned* to *checked*, and its floor moves to kit >=0.7.0, the release that introduced the contract. Porting note.

From the README

Synced from the plugin's README — the plugin's own documentation, kept in step with its repository.

An opt-in plugin: a fresh copy of the kit does not have it, and /rf-plugin add analytics (or the commands below) adds it. Everything it answers is scoped to the reader’s organisation.

What it adds

AreaWhat you get
UIAnalytics in the side nav and a Home quick link: /analytics (dashboards), /analytics/explore (a query builder over the cubes) and /analytics/:pageId (one dashboard). New organisations get a set of default dashboards
Semantic layerdrizzle-cube cubes over the kit’s own data — ActivityEvents, Users, Members, TenantUsers and TenantActivityDaily — each filtering on the reader’s tenant inside its own SQL. ActivityEvents answers admin-level readers only; other readers get no rows
API/api/analytics (dashboards: list, read, create, update, delete, restrict to groups), /cubejs-api/v1 (the Cube.js-compatible query API: meta, load, sql, dry-run, explain, batch, at most 50 queries per request). Every statement runs under a 20-second limit
MCP and agentsdrizzle-cube’s own MCP tools as analytics_discover, analytics_validate and analytics_load, served by the app’s MCP server (/mcp, with its OAuth sign-in) and offered to agent runs — not to the chat panel. Read-only, so they are listed under the default “all read-only tools” exposure
Background workOne fact table, analytics_tenant_activity_daily_facts, rebuilt every hour by the 15 * * * * cron; the analytics.refresh-facts job refreshes one organisation on demand
Dataanalytics_pages, analytics_page_groups, analytics_tenant_activity_daily_facts — all tenant-scoped with row-level security
CLIrocketflare analytics pages list, rocketflare analytics check-facts, rocketflare analytics refresh-facts
Agent skillsanalytics (start here: health check and routing), analytics-cubes (define and extend cubes, the isolation test), analytics-queries (query the API, ask Claude or ChatGPT through the app’s MCP server), analytics-dashboards (dashboards, templates, group visibility)

Other plugins can contribute cubes, fact tables, dashboard templates and isolation cases through extensions; the plugin reads and validates them, failing loudly and naming the contributor when one is malformed.

Requirements

  • Rocketflare kit 0.50.0 or later (minKit; earlier plugin releases support older kits). 0.50.0 reads the manifest’s dev block, which carries the @nivo/heatmap alias. The hourly rebuild is a perTenantTask, which 0.48.0 added, so it skips an organisation that turned analytics off; the cube tools answer egress (0.47.0); kit 0.41.0 owns /mcp, so an app upgrading past it upgrades this plugin in the same sitting.
  • No other plugin, no bindings and no secrets.
  • npm dependencies the install adds to apps/web: drizzle-cube (pinned 0.12.2), recharts, d3, react-grid-layout, react-is.

Install

The first command prints the plan and stops, the second applies it:

pnpm plugin add https://github.com/rocketflare-dev/rocketflare-plugins.git@analytics-v3.17.0 --subdir plugins/analytics
pnpm plugin add https://github.com/rocketflare-dev/rocketflare-plugins.git@analytics-v3.17.0 --subdir plugins/analytics --apply
pnpm db:generate --name plugin-analytics-3.9.0 && pnpm db:migrate

The plan lists the steps a plugin cannot make in your files, and pnpm provision cloudflare <env> writes them: both wrangler tomls gain the 15 * * * * cron, and /cubejs-api, /cubejs-api/* in [assets] run_worker_first. Nothing goes into apps/web/vite.config.ts (kit 0.50.0 and later): the dev server proxies /cubejs-api because it is one of the plugin’s apiPrefixes, and the @nivo/heatmap alias is the dev block in plugin.json.

First run

  1. pnpm dev, sign in, and open Analytics. An organisation created before the install gets its default dashboards the first time the list is opened.
  2. Open Explore to build a query over the cubes.
  3. rocketflare analytics check-facts shows whether the fact table is fresh; rocketflare analytics refresh-facts rebuilds it for your organisation now instead of at :15.

Using it with your coding agent

Ask for what you want — “add a revenue measure to the orders cube”, “show me active users by week”, “connect Claude Desktop to our analytics” — and the analytics-* skills take it from there. They know this plugin’s conventions (tenant scoping, frozen member names, the isolation test) as well as drizzle-cube’s. drizzle-cube’s own Claude Code plugin is an optional complement.

Permissions and data

  • Owners, admins and support can manage dashboards; members can read them. Everyone with a membership can query the cubes.
  • Every cube filters on the reader’s tenant itself — drizzle-cube adds no second line of defence — so every cube, contributed ones included, must have a case in the plugin’s cube-isolation test, and the host’s suite fails if one is missing.
  • Dashboards can be restricted to groups; a restricted dashboard answers the same 404 as a missing one.
  • /cubejs-api accepts a session or an API key, and answers only for that key’s tenant.
  • The analytics_* tools answer as the person who connected the client (or who started the agent run), in that organisation, exactly as /cubejs-api would answer them — ActivityEvents stays admin-only. A run with no person behind it is offered none. MCP clients connect with OAuth through the app’s own sign-in; API keys do not work on /mcp.

Known gaps

  • drizzle-cube is pinned to 0.12.2. Its MCP tools are pinned with it: a drizzle-cube upgrade is reviewed tool by tool (the plugin CLAUDE.md, “Upgrading drizzle-cube”), never absorbed.
  • drizzle-cube’s chart tool is not offered: it is an MCP App (a UI resource), which the app’s MCP server does not serve.
  • One example fact table; anything else you model is yours to add (the analytics-cubes skill walks through it).

More