Skip to content

Add PostHog analytics submodule - #5907

Open
bradleyshep wants to merge 1 commit into
bradley/submodules-corefrom
bradley/submodules-analytics
Open

Add PostHog analytics submodule#5907
bradleyshep wants to merge 1 commit into
bradley/submodules-corefrom
bradley/submodules-analytics

Conversation

@bradleyshep

Copy link
Copy Markdown
Contributor

Description of Changes

Adds server-side PostHog analytics and feature-flag evaluation to SpacetimeDB TypeScript modules.

  • Direct capture and durable queued events with explicit batch flushing.
  • Feature-flag evaluation and administrative delivery state.
  • Private provider configuration and synchronous HTTP requests.
  • Package documentation, tests, an economy example, and generated client bindings.

Builds on bradley/submodules-core for workspace configuration and shared example support. It has no dependency on the other integration branches.

Example screenshots

Existing example screenshots from #5823:

PostHog

PostHog example

API and ABI breaking changes

No existing SpacetimeDB API or ABI is changed. This adds new TypeScript package APIs that need review before merge.

Rollback safety impact

n/a. This adds opt-in TypeScript packages and examples; it does not change existing server storage formats.

Expected complexity level and risk

2/5

An isolated, opt-in PostHog integration that does not change existing server behavior. The main review points are queued event delivery, provider failures, and access to configuration in applications that use it.

Testing

Verified locally on bradley/submodules-analytics:

  • Frozen-lockfile install for the root, SDK, and present submodule workspaces.
  • Type checks for the added packages.
  • Existing test scripts for the added packages and examples.
  • Build scripts for the added packages and examples.
  • Regenerate client bindings and verify no tracked changes.
  • Lint and formatting checks for the added packages and examples.
  • Verify workspace dependencies are present in this branch.
  • Review the public analytics API and delivery-state behavior.
  • Run credentialed PostHog capture, flush, and feature-flag checks against a local SpacetimeDB instance.

Commands used for this group:

pnpm -r -F "./spacetime-posthog-ts/**" run typecheck
pnpm -r -F "./spacetime-posthog-ts/**" run test
pnpm -r -F "./spacetime-posthog-ts/**" run build
pnpm -r -F "./spacetime-posthog-ts/**" run lint

The TypeScript SDK was built first. Live deployment and provider tests were not run during split validation. Existing workspace peer-dependency warnings remain.

@bradleyshep bradleyshep mentioned this pull request Sep 9, 2026
7 tasks
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