Skip to content

feat(mosaic): record component mount telemetry for UserButton and OrganizationSwitcher - #10410

Open
alexcarpenter wants to merge 1 commit into
mainfrom
carp/mosaic-telemetry
Open

alexcarpenter wants to merge 1 commit into
mainfrom
carp/mosaic-telemetry

Conversation

@alexcarpenter

@alexcarpenter alexcarpenter commented Oct 23, 2026 •

Copy link
Copy Markdown
Member

Description

Mosaic's <UserButton /> and <OrganizationSwitcher /> now record a COMPONENT_MOUNTED event through the shared telemetry collector, once Clerk has loaded. The payload holds configuration only: modes, flags and counts. Swingset opts out with telemetry={false}.

Checklist

  • pnpm test runs as expected.
  • pnpm build runs as expected.
  • (If applicable) JSDoc comments have been added or updated for any package exports
  • (If applicable) Documentation has been updated

Type of change

  • 🐛 Bug fix
  • 🌟 New feature
  • 🔨 Breaking change
  • 📖 Refactoring / dependency upgrade / documentation
  • other:

@vercel

vercel Bot commented Oct 23, 2026 •

Copy link
Copy Markdown

The latest updates on your projects. Learn more about Vercel for GitHub.

Project Deployment Actions Updated
clerk-js-sandbox Ready Ready Preview Oct 23, 2026 11:05pm UTC
swingset Ready Ready Preview Oct 23, 2026 11:05pm UTC

Request Review

@changeset-bot

changeset-bot Bot commented Oct 23, 2026

Copy link
Copy Markdown

🦋 Changeset detected

Latest commit: a369324

The changes in this PR will be included in the next version bump.

This PR includes changesets to release 2 packages
Name Type
@clerk/mosaic Patch
@clerk/swingset Patch

Not sure what this means? Click here to learn what changesets are.

Click here if you're a maintainer who wants to add another changeset to this PR

@coderabbitai

coderabbitai Bot commented Oct 23, 2026 •

Copy link
Copy Markdown
Contributor

Review in Change Stack →

No actionable comments were generated in the recent review. 🎉

ℹ️ Recent review info
⚙️ Run configuration
📥 Commits

Reviewing files that changed from the base of the PR and between b68a77e and a369324.

📒 Files selected for processing: 11
  • .changeset/mosaic-component-mounted-telemetry.md
  • packages/mosaic/AGENTS.md
  • packages/mosaic/eslint/config.mjs
  • packages/mosaic/src/__tests__/feature/telemetry.ts
  • packages/mosaic/src/features/organization-switcher/__tests__/organization-switcher.feature.test.tsx
  • packages/mosaic/src/features/organization-switcher/organization-switcher.tsx
  • packages/mosaic/src/features/switcher/switcher.telemetry.ts
  • packages/mosaic/src/features/user-button/__tests__/user-button.feature.test.tsx
  • packages/mosaic/src/features/user-button/user-button.tsx
  • packages/mosaic/src/hooks/use-component-mounted-telemetry.ts
  • packages/swingset/src/app/(clerk)/layout.tsx
🔗 Linked repositories identified

CodeRabbit considers these linked repositories for cross-repo context during reviews:

Included review availability: This review used your included allowance. 2 included reviews remain after this review. Your included PR review attempts over the past 7 days set your current allowance at 4 reviews per hour.

📝 Walkthrough

OrganizationSwitcher and UserButton now record component-mounted telemetry with configuration derived from their props. Tests verify the recorded configuration for both components. The release note documents opt-out options, and the swingset ClerkProvider disables telemetry.

Priority: ⬇️ Low

Estimated code review effort: 3 (Moderate) | ~20 minutes

Suggested reviewers: austincalvelage, kalafut

Merge Risk: ⚪ Minimal · up to a3693

The reviewed telemetry change has no remaining actionable merge-blocking issue after normal checks.

Pre-merge checks: Passed 4 · Failed 1

Failed Failed checks: 1 warning

Check name Status Explanation Resolution
Docstring Coverage Warning Docstring coverage is 28.57% which is insufficient. The required threshold is 80.00%. Docstring coverage is scoped to functions touched by this diff. Analyzed 7 functions across 9 files. (2 skipped: 2… Write docstrings for the functions missing them to satisfy the coverage threshold.
Passed Passed checks: 4 passed
Check name Status Explanation
Title check Passed The title names the main change: recording COMPONENT_MOUNTED telemetry for the Mosaic UserButton and OrganizationSwitcher components. The changeset confirms both components report this event on develo…
Description check Passed The description states that Mosaic's UserButton and OrganizationSwitcher record a COMPONENT_MOUNTED event once Clerk loads. It also states the payload holds configuration only and that Swingset opts o…
Linked Issues check Passed Check skipped because no linked issues were found for this pull request.
Out of Scope Changes check Passed Check skipped because no linked issues were found for this pull request.
Full details: Title check

Explanation

The title names the main change: recording COMPONENT_MOUNTED telemetry for the Mosaic UserButton and OrganizationSwitcher components. The changeset confirms both components report this event on development instances. The title follows the conventional commit style and is specific enough for a teammate scanning history.

Full details: Description check

Explanation

The description states that Mosaic's UserButton and OrganizationSwitcher record a COMPONENT_MOUNTED event once Clerk loads. It also states the payload holds configuration only and that Swingset opts out with telemetry={false}. These points match the changeset, which adds the telemetry hook, the switcher telemetry helper, and the Swingset ClerkProvider change.

Full details: Docstring Coverage

Explanation

Docstring coverage is 28.57% which is insufficient. The required threshold is 80.00%. Docstring coverage is scoped to functions touched by this diff. Analyzed 7 functions across 9 files. (2 skipped: 2 unsupported.)

Resolution

Write docstrings for the functions missing them to satisfy the coverage threshold.

  • Autofix · Keep fixing CodeRabbit findings and required CI, and resolving merge conflicts

Warning

Linked repositories: Some configured repositories could not be included in this review. Cross-repository analysis may be incomplete. Please check linked-repository access and settings.

Comment @coderabbitai help to get the list of available commands.

@pkg-pr-new

pkg-pr-new Bot commented Oct 23, 2026

Copy link
Copy Markdown

Open in StackBlitz

@clerk/astro

npm i https://pkg.pr.new/@clerk/astro@10410

@clerk/backend

npm i https://pkg.pr.new/@clerk/backend@10410

@clerk/chrome-extension

npm i https://pkg.pr.new/@clerk/chrome-extension@10410

@clerk/clerk-js

npm i https://pkg.pr.new/@clerk/clerk-js@10410

@clerk/electron

npm i https://pkg.pr.new/@clerk/electron@10410

@clerk/electron-passkeys

npm i https://pkg.pr.new/@clerk/electron-passkeys@10410

@clerk/eslint-plugin

npm i https://pkg.pr.new/@clerk/eslint-plugin@10410

@clerk/expo

npm i https://pkg.pr.new/@clerk/expo@10410

@clerk/expo-biometrics

npm i https://pkg.pr.new/@clerk/expo-biometrics@10410

@clerk/expo-google-signin

npm i https://pkg.pr.new/@clerk/expo-google-signin@10410

@clerk/expo-native-components

npm i https://pkg.pr.new/@clerk/expo-native-components@10410

@clerk/expo-passkeys

npm i https://pkg.pr.new/@clerk/expo-passkeys@10410

@clerk/express

npm i https://pkg.pr.new/@clerk/express@10410

@clerk/fastify

npm i https://pkg.pr.new/@clerk/fastify@10410

@clerk/hono

npm i https://pkg.pr.new/@clerk/hono@10410

@clerk/localizations

npm i https://pkg.pr.new/@clerk/localizations@10410

@clerk/mosaic

npm i https://pkg.pr.new/@clerk/mosaic@10410

@clerk/nextjs

npm i https://pkg.pr.new/@clerk/nextjs@10410

@clerk/nuxt

npm i https://pkg.pr.new/@clerk/nuxt@10410

@clerk/react

npm i https://pkg.pr.new/@clerk/react@10410

@clerk/react-router

npm i https://pkg.pr.new/@clerk/react-router@10410

@clerk/shared

npm i https://pkg.pr.new/@clerk/shared@10410

@clerk/tanstack-react-start

npm i https://pkg.pr.new/@clerk/tanstack-react-start@10410

@clerk/testing

npm i https://pkg.pr.new/@clerk/testing@10410

@clerk/ui

npm i https://pkg.pr.new/@clerk/ui@10410

@clerk/upgrade

npm i https://pkg.pr.new/@clerk/upgrade@10410

@clerk/vue

npm i https://pkg.pr.new/@clerk/vue@10410

commit: a369324

This branch was successfully deployed

2 active deployments
Preview – swingset — a369324e Deployed Oct 23, 2026 by vercel[bot]
Preview – clerk-js-sandbox — a369324e Deployed Oct 23, 2026 by vercel[bot]
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

Projects

None yet

Development

Successfully merging this pull request may close these issues.

1 participant