feat(electron): allow custom user agent for session activity#9066
Conversation
🦋 Changeset detectedLatest commit: 679d52f The changes in this PR will be included in the next version bump. This PR includes changesets to release 1 package
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 |
|
The latest updates on your projects. Learn more about Vercel for GitHub.
|
|
No actionable comments were generated in the recent review. 🎉 ℹ️ Recent review info⚙️ Run configurationConfiguration used: Repository YAML (base), Repository UI (inherited) Review profile: CHILL Plan: Pro Plus Run ID: 📒 Files selected for processing (2)
🚧 Files skipped from review as they are similar to previous changes (2)
📝 WalkthroughWalkthroughAdds an optional ChangesElectron userAgent Option
Estimated code review effort: 2 (Simple) | ~10 minutes Suggested reviewers: Poem
🚥 Pre-merge checks | ✅ 5✅ Passed checks (5 passed)
✨ Finishing Touches📝 Generate docstrings
Comment |
@clerk/astro
@clerk/backend
@clerk/chrome-extension
@clerk/clerk-js
@clerk/electron
@clerk/electron-passkeys
@clerk/eslint-plugin
@clerk/expo
@clerk/expo-passkeys
@clerk/express
@clerk/fastify
@clerk/hono
@clerk/localizations
@clerk/nextjs
@clerk/nuxt
@clerk/react
@clerk/react-router
@clerk/shared
@clerk/tanstack-react-start
@clerk/testing
@clerk/ui
@clerk/upgrade
@clerk/vue
commit: |
| const passkeys = options.passkeys ? setupPasskeysMain() : null; | ||
|
|
||
| if (options.userAgent) { | ||
| app.userAgentFallback = options.userAgent; |
There was a problem hiding this comment.
There was a problem hiding this comment.
Actionable comments posted: 1
🤖 Prompt for all review comments with AI agents
Verify each finding against current code. Fix only still-valid issues, skip the
rest with a brief reason, keep changes minimal, and validate.
Inline comments:
In `@packages/electron/src/main/__tests__/create-clerk-bridge.test.ts`:
- Around line 13-14: Add a test assertion for the plain createClerkBridge({
storage }) path to verify app.userAgentFallback remains unchanged when no
userAgent is provided. Update the create-clerk-bridge test around the
createClerkBridge and app mock setup so it explicitly checks the default
behavior alongside the existing userAgentFallback case, ensuring the omitted
userAgent branch does not modify the fallback.
🪄 Autofix (Beta)
Fix all unresolved CodeRabbit comments on this PR:
- Push a commit to this branch (recommended)
- Create a new PR with the fixes
ℹ️ Review info
⚙️ Run configuration
Configuration used: Repository YAML (base), Repository UI (inherited)
Review profile: CHILL
Plan: Pro Plus
Run ID: 8353bbde-4e9c-4740-a3a4-69c3eb6d617c
📒 Files selected for processing (5)
.changeset/electron-user-agent.mdpackages/electron/README.mdpackages/electron/src/main/__tests__/create-clerk-bridge.test.tspackages/electron/src/main/create-clerk-bridge.tspackages/electron/src/shared/types.ts
✅ Files skipped from review due to trivial changes (3)
- packages/electron/src/shared/types.ts
- packages/electron/README.md
- .changeset/electron-user-agent.md
Summary
Adds a
userAgentoption tocreateClerkBridge()for Electron apps that want to control how the app appears in UserProfile session activity.The option sets Electron's
app.userAgentFallback, and the README now shows the setup alongside the existing bridge configuration.Summary by CodeRabbit
New Features
userAgentwhen creating the Clerk bridge to improve UserProfile session activity attribution.Bug Fixes
userAgentis used.Documentation
userAgentconfiguration example.