Skip to content

feat: add identify/group - #210

Merged
feugy merged 1 commit into
canaryfrom
damienfeugas/exp-3473
Sep 17, 2026
Merged

feugy merged 1 commit into
canaryfrom
damienfeugas/exp-3473

Conversation

@feugy

@feugy feugy commented Sep 17, 2026 •

Copy link
Copy Markdown
Member

🖖 What's in there?

  • Adds identify() and group() to @vercel/analytics and @vercel/analytics/server. They post to /_vercel/insights/identify and /group with flat traits.
  • Every operation (track, pageview, identify, group, trackExposure) forwards an optional, internal envelope untouched, next to the regular payload.
  • The envelope is a runtime-only contract: it is absent from the public type declarations, per the CDP transport ADR.

🤺 How to test?

  • pnpm -F @vercel/analytics test
  • pnpm -F @vercel/analytics build, then check that dist/**/*.d.ts does not expose the internal option.

🔬 Notes to reviewers

  • Public overload signatures hide the internal option; the implementation signatures accept InternalOptions. Tests use withCdp() as the single assertion CDP will also need.
  • Nested traits are rejected like nested track properties: ingestion only accepts primitives in ed.
  • Server endpoints follow the trackExposure convention: VERCEL_WEB_ANALYTICS_ENDPOINT as base URL, VERCEL_WEB_ANALYTICS_IDENTIFY_ENDPOINT / _GROUP_ENDPOINT as verbatim overrides.

🔗 Related PRs

  • vercel/front#86373 — analytics script support.
  • vercel/api#91839 — ingestion routes, DSN gating, and envelope validation.
  • vercel/api#91807 — drains preserve the envelope, identify and group.
  • vercel/front#86210 — the ADR this implements.
  • EXP-3473

Adds identify() and group() to the browser and server entries, posting
to /_vercel/insights/identify and /group with flat traits.

Every operation (track, pageview, identify, group, trackExposure) now
forwards a runtime-only __cdp envelope untouched, next to the regular
payload. The field is deliberately absent from the public type
declarations, as agreed in the CDP transport ADR.
@feugy
feugy requested a review from rvnewolf September 17, 2026 12:34
@vercel

vercel Bot commented Sep 17, 2026

Copy link
Copy Markdown

Your Vercel team Analytics Test Projects is not permitted to deploy from this git repository. Contact an administrator to add github organization vercel as a Protected Git Scope in Analytics Test Projects on Vercel. Once added, commit again to see your changes.

Learn more: https://vercel.com/docs/security/protected-git-scopes

@feugy feugy changed the title feat: add identify/group and carry the CDP envelope feat: add identify/group Sep 17, 2026
@feugy
feugy merged commit 9c50d43 into canary Sep 17, 2026
7 of 15 checks passed
@feugy
feugy deleted the damienfeugas/exp-3473 branch September 17, 2026 14:47
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