Skip to content

Add OpenUI Cloud build telemetry#784

Draft
zahlekhan wants to merge 1 commit into
thesysdev:mainfrom
zahlekhan:codex/add-openui-build-telemetry
Draft

Add OpenUI Cloud build telemetry#784
zahlekhan wants to merge 1 commit into
thesysdev:mainfrom
zahlekhan:codex/add-openui-build-telemetry

Conversation

@zahlekhan

Copy link
Copy Markdown
Contributor

What changed

  • add a compiler.runAfterProductionCompile hook to the OpenUI Cloud Next.js template
  • generate a random project-scoped telemetry ID only when CLI telemetry is enabled
  • attach that project ID to the existing scaffold funnel and the compiler event
  • send an allowlisted, best-effort PostHog event with a one-second timeout
  • disable PostHog person profiles and geo-IP enrichment for the compiler event
  • document the event semantics, collected fields, and opt-out controls
  • add coverage for payload privacy, stable identity, opt-outs, malformed metadata, offline behavior, and timeouts

Why

The existing CLI telemetry measures scaffolding and OIDC authentication, but it does not show whether a generated OpenUI Cloud project reaches production compilation. This adds a directional activation signal without wrapping package-manager build scripts or collecting project code, paths, prompts, API keys, environment values, or build output.

The event is named openui_template_production_compile_completed. It intentionally does not claim that the overall build succeeded because Next.js runs this hook before type checking and static generation.

Projects created with --no-telemetry, DO_NOT_TRACK=1, or OPENUI_TELEMETRY_DISABLED=1 do not receive a project marker. Existing generated projects also honor both environment opt-outs at build time.

Validation

  • pnpm --dir packages/openui-cli run ci
  • 8 build-telemetry tests passing
  • generated Next.js 16.1.6 production build completed successfully with the hook running between compilation and TypeScript
  • npm package dry run confirmed the hidden template helper is included in the published CLI artifact

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

1 participant