Skip to content

feat(session-replay): add Unity onboarding support - #94235

Merged
trunk-io[bot] merged 7 commits into
masterfrom
feat/unity-session-replay-support
Sep 4, 2026
Merged

feat(session-replay): add Unity onboarding support#94235
trunk-io[bot] merged 7 commits into
masterfrom
feat/unity-session-replay-support

Conversation

@marandaneto

@marandaneto marandaneto commented Sep 3, 2026

Copy link
Copy Markdown
Member

Problem

Unity developers can record sessions, but Session Replay onboarding does not offer Unity installation instructions or link to the Unity replay guide.

The recording configuration services also do not recognize the Unity SDK user agent when recording domains are configured.

Changes

  • Unity now appears in the Session Replay SDK selector with installation, configuration, platform, and privacy guidance.
  • The onboarding instructions identify default settings and explain that WebGL disables replay.
  • Both Rust recording configuration paths now allow posthog-unity for mobile and desktop SDK requests.
  • Focused tests cover the SDK selector and both recording-domain implementations.

Screenshot not included because the local app stack failed before it could render the onboarding flow.

How did you test this code?

  • Rust tests verify that both recording-domain implementations accept the Unity user agent.
  • The focused Jest test verifies that Unity appears with the Session Replay documentation link.
  • The frontend TypeScript check passed.
  • hogli ci:preflight --fix passed.
  • Manual UI testing was blocked by local database hostname resolution and a pnpm esbuild link error during stack startup.

👉 Stay up-to-date with PostHog coding conventions for a smoother review.

Automatic notifications

  • Publish to changelog?

Docs update

The existing Unity Session Replay guide already documents this setup. This PR links the onboarding flow to that guide.

🤖 Agent context

Autonomy: Human-driven (agent-assisted)

Pi implemented and reviewed this change using the public Unity SDK repository and existing PostHog onboarding patterns.

Skills invoked: /writing-ui-components, /writing-user-facing-copy, /writing-tests, /writing-code-comments, /running-ci-preflight, /run-posthog, /autoreview, /writing-pr-descriptions, /pr, /merge-main, and /address-pr-comments.

@marandaneto marandaneto self-assigned this Sep 3, 2026
@trunk-io

trunk-io Bot commented Sep 3, 2026

Copy link
Copy Markdown

😎 Merged successfully - details.

@marandaneto marandaneto added the skip-inkeep-docs Use this label to skip an Inkeep docs PR in posthog.com label Sep 3, 2026
@marandaneto
marandaneto requested review from a team, TueHaulund, arnohillen, fasyy612 and ksvat and removed request for a team September 3, 2026 13:52
@marandaneto
marandaneto marked this pull request as ready for review September 3, 2026 13:52
@github-actions

github-actions Bot commented Sep 3, 2026

Copy link
Copy Markdown
Contributor

🦔 Hogbox preview · ❌ build failed

The preview didn't come up for commit 213e740. See the build log for the failing step. It'll retry on the next push.

Previews are optional and never block merging. A failure here is often a hogland or tailnet hiccup rather than anything in your PR, so the check stays green and this comment is the status.

@github-actions

github-actions Bot commented Sep 3, 2026

Copy link
Copy Markdown
Contributor

🤖 CI report

Trunk lane — non-backend lane

This PR is assigned to the non-backend lane. It does not run backend Python tests and may merge in parallel with PRs in other lanes.

Complexity (TypeScript) — clean

Cyclomatic complexity above the limit in changed typescript files (10 for production files, 15 for test files). Warn only: worth simplifying when you next touch these functions.

⚠️ Bundle size — 🔺 +3.6 KiB (+0.0%)

Uncompressed size of every built .js bundle, compared against the base branch.

Total: 68.29 MiB · 🔺 +3.6 KiB (+0.0%)

File Size Δ vs base
posthog-app/src/scenes/onboarding/Onboarding.js 821.2 KiB 🔺 +3.6 KiB (+0.4%)

Posted automatically by build-bundle-size-report · uncompressed bytes from dist-report

Eager graph — within budget

How much code each root ships on the eager path — downloaded and parsed before the surface is interactive. Measured from the esbuild output chunks (post-tree-shake, static imports only); lazy import() / React.lazy chunks are not counted.

Root Eager (shipped) Δ vs base Budget
entry (logged-out pages, app bootstrap)
src/index.tsx
1.45 MiB · 22 files no change ███░░░░░░░ 32.3% of 4.51 MiB
authenticated shell (every logged-in page)
src/scenes/AuthenticatedShell.tsx
8.89 MiB · 3,268 files no change █████████░ 91.5% of 9.71 MiB

🟢 node_modules/monaco-editor/ stays out of src/index.tsx
🟢 src/lib/components/ActivityLog/describers stays out of src/index.tsx
🟢 [object Object] stays out of src/index.tsx
🟢 [object Object] stays out of src/index.tsx
🟢 node_modules/monaco-editor/ stays out of src/scenes/AuthenticatedShell.tsx
🟢 src/lib/components/ActivityLog/describers stays out of src/scenes/AuthenticatedShell.tsx
🟢 [object Object] stays out of src/scenes/AuthenticatedShell.tsx
🟢 [object Object] stays out of src/scenes/AuthenticatedShell.tsx

Largest files eagerly shipped from src/index.tsx
Size File
126.8 KiB ../node_modules/.pnpm/react-dom@18.3.1_react@18.3.1/node_modules/react-dom/cjs/react-dom.production.min.js
24.6 KiB ../node_modules/.pnpm/buffer@6.0.3/node_modules/buffer/index.js
6.3 KiB ../node_modules/.pnpm/react@18.3.1/node_modules/react/cjs/react.production.min.js
4.5 KiB ../node_modules/.pnpm/@jspm+core@2.1.0/node_modules/@jspm/core/nodelibs/browser/process.js
3.9 KiB ../node_modules/.pnpm/scheduler@0.23.2/node_modules/scheduler/cjs/scheduler.production.min.js
1.4 KiB ../node_modules/.pnpm/base64-js@1.5.1/node_modules/base64-js/index.js
1.3 KiB src/RootErrorBoundary.tsx
912 B ../node_modules/.pnpm/ieee754@1.2.1/node_modules/ieee754/index.js
854 B src/scenes/ChunkLoadErrorBoundary.tsx
762 B src/index.tsx
Largest files eagerly shipped from src/scenes/AuthenticatedShell.tsx
Size File
307.3 KiB ../node_modules/.pnpm/posthog-js@1.425.1_@types+react@18.3.27_react@18.3.1/node_modules/posthog-js/dist/rrweb.js
272.4 KiB ../node_modules/.pnpm/posthog-js@1.425.1_@types+react@18.3.27_react@18.3.1/node_modules/posthog-js/dist/module.js
267.7 KiB ../node_modules/.pnpm/@posthog+icons@0.38.0_react-dom@18.3.1_react@18.3.1__react@18.3.1/node_modules/@posthog/icons/dist/posthog-icons.es.js
255.2 KiB src/taxonomy/core-filter-definitions-by-group.json
154.2 KiB ../node_modules/.pnpm/re2js@0.4.1/node_modules/re2js/build/index.esm.js
126.8 KiB ../node_modules/.pnpm/react-dom@18.3.1_react@18.3.1/node_modules/react-dom/cjs/react-dom.production.min.js
104.4 KiB src/lib/api.ts
95.8 KiB ../packages/quill/packages/quill/dist/index.js
93.3 KiB ../node_modules/.pnpm/prosemirror-view@1.40.1/node_modules/prosemirror-view/dist/index.js
90.6 KiB ../node_modules/.pnpm/@tiptap+core@3.20.6_@tiptap+pm@3.20.6/node_modules/@tiptap/core/dist/index.js

Posted automatically by check-eager-graph · sizes are eager output bytes (shipped, post-tree-shake) from the esbuild metafile · part of #32479

Toolbar bundle — eager 2.28 MiB within budget

What the toolbar ships to customer pages, measured from the esbuild output (minified, post-tree-shake). The eager set is the entry plus everything statically imported from it — fetched before any feature runs; deferred chunks load lazily. The eager guardrail is 5.72 MiB. Each output file must also stay below 10 MB, where CloudFront stops compressing it. The module boundary is enforced separately by check-toolbar-graph.

Metric Size Δ vs base Budget
Eager (shipped)
entry + static imports
2.28 MiB · 18 files no change ████░░░░░░ 39.8% of 5.72 MiB
Deferred (lazy) 2.11 MiB · 45 files no change n/a — loads on demand
Loader dist/toolbar.js 1.1 KiB no change █░░░░░░░░░ 5.8% of 19.5 KiB
Largest eagerly-shipped chunks
Size File
754.1 KiB dist/toolbar/toolbar-app-HCAVZOPH.css
599.5 KiB dist/toolbar/chunk-chunk-IP5OG3UU.js
484.7 KiB dist/toolbar/chunk-chunk-EL6RQSMS.js
135.6 KiB dist/toolbar/chunk-chunk-7UG5SHZR.js
131.8 KiB dist/toolbar/chunk-chunk-FDH2IBXT.js
71.3 KiB dist/toolbar/toolbar-app-P2YIMAVU.js
69.0 KiB dist/toolbar/chunk-chunk-TSAL54PB.js
35.6 KiB dist/toolbar/chunk-chunk-TX5RGCWJ.js
21.0 KiB dist/toolbar/chunk-chunk-6WYJMFDF.js
6.8 KiB dist/toolbar/chunk-chunk-DV7IWQNF.js

Posted automatically by check-toolbar-size · sizes are toolbar output bytes (shipped, post-tree-shake) from the esbuild metafile

Dist folder size — 🔺 +11.0 KiB (+0.0%)

Total size of the built frontend/dist folder (all assets), compared against the base branch.

Total: 1458.83 MiB · 🔺 +11.0 KiB (+0.0%)

Playwright — all passed

All tests passed.

View test results →

⚠️ Backend snapshots — 1 updated (1 modified, 0 added, 0 deleted)

Query snapshots: Backend query snapshots updated

Changes: 1 snapshots (1 modified, 0 added, 0 deleted)

What this means:

  • Query snapshots have been automatically updated to match current output
  • These changes reflect modifications to database queries or schema

Next steps:

  • Review the query changes to ensure they're intentional
  • If unexpected, investigate what caused the query to change

Review snapshot changes →

ℹ️ Docs preview — preview build triggered

Docs from this PR will be published at posthog.com.

Project Preview Updated (UTC)
posthog.com Open preview Sep 4, 2026, 8:16 AM

The preview should be ready in about 10 minutes. Open the preview at /handbook/engineering/.

@pr-assigner-resolver-posthog
pr-assigner-resolver-posthog Bot requested review from a team, MattBro, fercgomes and rafaeelaudibert and removed request for a team September 3, 2026 13:54
@greptile-apps

greptile-apps Bot commented Sep 3, 2026

Copy link
Copy Markdown
Contributor
Prompt To Fix All With AI
### Issue 1
products/session_replay/frontend/onboarding/steps.tsx:97-101
**Deduplication drops Unity onboarding**

When Session Replay is selected as a secondary product, the shared `POSTHOG_JS` deduplication retains the primary product's install step and discards this Unity-capable step, causing the combined onboarding flow to omit the Unity option and its replay instructions.

---

For each issue above, determine whether it is valid and should be fixed. If so, fix it directly.

Reviews (1): Last reviewed commit: "feat(session-replay): add Unity onboardi..." | Re-trigger Greptile

Comment thread products/session_replay/frontend/onboarding/steps.tsx
@trunk-io

trunk-io Bot commented Sep 3, 2026

Copy link
Copy Markdown

Static BadgeStatic BadgeStatic Badge

View Full Report ↗︎Docs

Comment thread posthog/api/utils.py Outdated
Comment thread docs/onboarding/session-replay/unity.tsx Outdated
Comment thread docs/onboarding/session-replay/unity.tsx
@turnipdabeets
turnipdabeets requested a review from a team September 3, 2026 15:37

@rafaeelaudibert rafaeelaudibert left a comment

Copy link
Copy Markdown
Member

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Approving from the Growth side, but I believe there are some client libraries changes you might need to work on, @turnipdabeets and I commented

Comment thread posthog/api/utils.py
@trunk-io
trunk-io Bot merged commit 17b35cf into master Sep 4, 2026
230 of 231 checks passed
@trunk-io
trunk-io Bot deleted the feat/unity-session-replay-support branch September 4, 2026 14:09
@deployment-status-posthog

deployment-status-posthog Bot commented Sep 4, 2026

Copy link
Copy Markdown

Deploy status

Environment Status Deployed At Workflow
dev ✅ Deployed 2026-09-04 14:39 UTC Run
prod-us ✅ Deployed 2026-09-04 14:57 UTC Run
prod-eu ✅ Deployed 2026-09-04 14:57 UTC Run

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

Labels

skip-inkeep-docs Use this label to skip an Inkeep docs PR in posthog.com

Projects

None yet

Development

Successfully merging this pull request may close these issues.

3 participants