Skip to content

docs: web-to-app identity bridging investigation and proposal#4543

Closed
devin-ai-integration[bot] wants to merge 3 commits intomainfrom
chore/1773308895-web-to-app-identity-bridging-proposal
Closed

docs: web-to-app identity bridging investigation and proposal#4543
devin-ai-integration[bot] wants to merge 3 commits intomainfrom
chore/1773308895-web-to-app-identity-bridging-proposal

Conversation

@devin-ai-integration
Copy link
Copy Markdown
Contributor

@devin-ai-integration devin-ai-integration bot commented Mar 12, 2026

Summary

Adds a developer docs page (apps/web/content/docs/developers/13.web-to-app-identity-bridging.mdx) that investigates why 86% of app installs are unattributed and proposes a solution for bridging PostHog identity between the website and the desktop app.

The document covers:

  • Current state: How PostHog is initialized on the web (browser anonymous ID via posthog.init()) vs. desktop (machine fingerprint via hypr_host::fingerprint()), how $identify calls link them at sign-in, and what events are tracked on each side.
  • Identity gap: An ASCII diagram showing exactly where the chain breaks — at the download redirect (no ID passed to Crabnebula URL) and at app install (no mechanism for DMG to carry a token into the installed app).
  • Proposal: A two-phase approach — Phase 1 improves the existing sign-in bridge with posthog.alias() and localStorage persistence; Phase 2 adds a silent browser-based attribution link during onboarding that works without sign-in.
  • Alternatives considered: Deferred deep links, custom download server, clipboard-based passing, alias-only at sign-in.

This is investigation + proposal only — no implementation changes.

Updates since last revision

  • Fixed MDX build failure caused by --> and <-- arrow characters being parsed as JSX. Replaced with Unicode arrows ( / ). CI now passes.

Review & Testing Checklist for Human

  • Verify the identity flow description is accurate: Confirm that the web auth callback (apps/web/src/routes/_view/callback/auth.tsx) and desktop auth handler (apps/desktop/src/auth/context.tsx) work as described — specifically that sign-in opens in the user's default browser and that the two $identify calls merge browser → supabaseUserId ← machineFingerprint.
  • Validate Phase 2 assumption: The proposal assumes onboarding can open a browser page (char.com/link) before sign-in. Confirm this is feasible within the current onboarding flow without adding friction.
  • Review privacy section: Ensure the localStorage-based approach and server-side attribution endpoint with 30-day TTL are acceptable from a privacy/compliance perspective.

Notes

  • The "~20-30% unattributed" estimate after implementation is speculative — actual impact depends on what fraction of users complete onboarding and use the same browser.
  • The document is placed in apps/web/content/docs/developers/ alongside the existing analytics inventory doc (12.analytics.mdx).
  • This is a docs-only change — no functional code is modified. The proposal document will render on the Netlify deploy preview.

Link to Devin session: https://app.devin.ai/sessions/62368e7c5e134597918cd1df0d7148c1
Requested by: @ComputelessComputer

@netlify
Copy link
Copy Markdown

netlify bot commented Mar 12, 2026

Deploy Preview for hyprnote-storybook canceled.

Name Link
🔨 Latest commit c8af886
🔍 Latest deploy log https://app.netlify.com/projects/hyprnote-storybook/deploys/69b28d0b71662e0008c17679

@netlify
Copy link
Copy Markdown

netlify bot commented Mar 12, 2026

Deploy Preview for hyprnote ready!

Name Link
🔨 Latest commit d7499d4
🔍 Latest deploy log https://app.netlify.com/projects/hyprnote/deploys/69d44ef00698440008b92d4e
😎 Deploy Preview https://deploy-preview-4543--hyprnote.netlify.app
📱 Preview on mobile
Toggle QR Code...

QR Code

Use your smartphone camera to open QR code link.

To edit notification comments on pull requests, go to your Netlify project configuration.

@devin-ai-integration
Copy link
Copy Markdown
Contributor Author

🤖 Devin AI Engineer

I'll be helping with this pull request! Here's what you should know:

✅ I will automatically:

  • Address comments on this PR that start with 'DevinAI' or '@devin'.
  • Look at CI failures and help fix them

Note: I can only respond to comments from users who have write access to this repository.

⚙️ Control Options:

  • Disable automatic comment and CI monitoring

Copy link
Copy Markdown
Contributor Author

@devin-ai-integration devin-ai-integration bot left a comment

Choose a reason for hiding this comment

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

Devin Review found 3 potential issues.

View 1 additional finding in Devin Review.

Open in Devin Review

Copy link
Copy Markdown
Contributor Author

Choose a reason for hiding this comment

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

🚩 This is an internal investigation doc published as public developer documentation

This document reads as an internal investigation and proposal (analyzing current identity systems, discussing alternative approaches, proposing a phased rollout). It's being added to content/docs/developers/ which is the public-facing developer docs at char.com/docs/developers. Other docs in this directory are how-to guides (setup, env, login, deeplinks, etc.). This investigation/proposal may not be appropriate as permanent public documentation — it describes internal analytics plumbing and PostHog implementation details. Consider whether this belongs in the public docs or in an internal document/issue instead.

Open in Devin Review

Was this helpful? React with 👍 or 👎 to provide feedback.

@@ -0,0 +1,220 @@
---
Copy link
Copy Markdown
Contributor Author

Choose a reason for hiding this comment

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

🟡 Duplicate order number 13 collides with existing 13.languages.mdx

The new file 13.web-to-app-identity-bridging.mdx uses order prefix 13, which is already taken by 13.languages.mdx. The docs collection extracts the numeric prefix for ordering (apps/web/content-collections.ts:287-288) and sorts docs by this order (apps/web/src/routes/_view/docs/-structure.ts:48). Having two docs with order = 13 in the same section causes non-deterministic relative ordering between "Language Support" and "Web-to-App Identity Bridging" in the docs sidebar. The next available number would be 15 (since 14.bug-report.mdx exists) or 19 (since 18.release.mdx is the highest).

Prompt for agents
The file 13.web-to-app-identity-bridging.mdx uses the numeric prefix 13, which collides with the existing 13.languages.mdx. Both files are in apps/web/content/docs/developers/ and the docs collection (apps/web/content-collections.ts lines 287-288) extracts this prefix for ordering in the sidebar. Rename the file to use the next available number. Looking at existing files: 14 is taken (bug-report), 15 is unused but 16 and 17 and 18 are taken. Consider using 15 or 19 (next after 18.release.mdx).
Open in Devin Review

Was this helpful? React with 👍 or 👎 to provide feedback.

---
title: "Web-to-App Identity Bridging"
section: "Developers"
description: "Investigation and proposal for connecting website visitor identity to desktop app installs"
Copy link
Copy Markdown
Contributor Author

Choose a reason for hiding this comment

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

🚩 Frontmatter uses description but docs schema only defines summary

The docs Zod schema at apps/web/content-collections.ts:253-257 defines summary: z.string().optional() but does not define a description field. This new file uses description in its frontmatter. However, this is the established convention — virtually every other doc in the content/docs/ directory also uses description rather than summary (only 2 of ~30+ docs use summary). Zod silently strips unrecognized keys, so the field is dropped without error. This is a pre-existing inconsistency, not introduced by this PR, but it means the description text is effectively unused by the content system.

Open in Devin Review

Was this helpful? React with 👍 or 👎 to provide feedback.

@netlify
Copy link
Copy Markdown

netlify bot commented Apr 7, 2026

Deploy Preview for char-cli-web ready!

Name Link
🔨 Latest commit d7499d4
🔍 Latest deploy log https://app.netlify.com/projects/char-cli-web/deploys/69d44ef04daa670008baf292
😎 Deploy Preview https://deploy-preview-4543--char-cli-web.netlify.app
📱 Preview on mobile
Toggle QR Code...

QR Code

Use your smartphone camera to open QR code link.

To edit notification comments on pull requests, go to your Netlify project configuration.

devin-ai-integration bot and others added 3 commits April 7, 2026 00:25
Co-Authored-By: John <john@hyprnote.com>
Co-Authored-By: John <john@hyprnote.com>
…lision with 13.languages.mdx

Co-Authored-By: John <john@hyprnote.com>
@devin-ai-integration devin-ai-integration bot force-pushed the chore/1773308895-web-to-app-identity-bridging-proposal branch from a3a9f24 to d7499d4 Compare April 7, 2026 00:25
@ComputelessComputer ComputelessComputer deleted the chore/1773308895-web-to-app-identity-bridging-proposal branch April 11, 2026 03:11
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