Skip to content

Conversation

@wobsoriano
Copy link
Member

@wobsoriano wobsoriano commented Nov 11, 2025

Description

Type fix PR that allows hiding of "API Keys" nav and page in UserProfile component within UserButton

<UserButton
  userProfileProps={{
    apiKeysProps: { hide: false }
  }}
/>
Screenshot 2025-11-11 at 5 26 59 AM

This already works at runtime

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:

Summary by CodeRabbit

  • Bug Fixes
    • Restored API keys support in the user menu: API key-related settings are now exposed and configurable from the User Button / User Profile components.

@changeset-bot
Copy link

changeset-bot bot commented Nov 11, 2025

🦋 Changeset detected

Latest commit: 93cd916

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

This PR includes changesets to release 11 packages
Name Type
@clerk/clerk-react Patch
@clerk/vue Patch
@clerk/astro Patch
@clerk/chrome-extension Patch
@clerk/elements Patch
@clerk/clerk-expo Patch
@clerk/nextjs Patch
@clerk/react-router Patch
@clerk/remix Patch
@clerk/tanstack-react-start Patch
@clerk/nuxt 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

@vercel
Copy link

vercel bot commented Nov 11, 2025

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

Project Deployment Preview Comments Updated (UTC)
clerk-js-sandbox Ready Ready Preview Comment Nov 11, 2025 1:43pm

@coderabbitai
Copy link
Contributor

coderabbitai bot commented Nov 11, 2025

Walkthrough

Expanded the userProfileProps Pick to include apiKeysProps across UserButton typings and components (React, Astro, Vue, and shared types), and added a changeset entry .changeset/honest-pears-play.md documenting a patch release noting the fix.

Changes

Cohort / File(s) Change Summary
React component type
packages/react/src/components/uiComponents.tsx
Widened UserButtonPropsWithoutCustomPages.userProfileProps Pick to include 'apiKeysProps' in addition to 'additionalOAuthScopes' and 'appearance'. No runtime logic changes.
Astro component type
packages/astro/src/astro-components/interactive/UserButton/UserButton.astro
Added 'apiKeysProps' to the userProfileProps?: Pick<UserProfileProps, ...> signature. No control-flow changes.
Vue component type
packages/vue/src/components/ui-components/UserButton/UserButton.vue
Added 'apiKeysProps' to the userProfileProps Pick over UserProfileProps. No runtime logic changes.
Shared types
packages/shared/src/types/clerk.ts
Extended UserButtonProps.userProfileProps Pick to include 'apiKeysProps' (previously absent). Type surface expanded; no behavior changes.
Changeset / release note
.changeset/honest-pears-play.md
Added a changeset entry for a patch release noting: "Fixed missing API keys props within ."

Estimated code review effort

🎯 2 (Simple) | ⏱️ ~10 minutes

  • Repetitive, localized type extensions across several packages.
  • Files to review closely:
    • packages/shared/src/types/clerk.ts — public type surface change.
    • packages/react/src/components/uiComponents.tsx — exported prop type.
    • packages/astro/.../UserButton.astro and packages/vue/.../UserButton.vue — ensure typings align with runtime prop forwarding.
    • .changeset/honest-pears-play.md — verify phrasing and affected packages.

Poem

🐰 I hopped through types with joyful leaps,

A tiny key found space to keep.
Props expanded, tidy and bright,
UserButton ready — snug and light.
🥕🔑

Pre-merge checks and finishing touches

✅ Passed checks (3 passed)
Check name Status Explanation
Description Check ✅ Passed Check skipped - CodeRabbit’s high-level summary is enabled.
Title check ✅ Passed The title accurately describes the main change: enabling the ability to hide the UserProfile API keys page within UserButton across three packages by allowing the apiKeysProps parameter.
Docstring Coverage ✅ Passed No functions found in the changed files to evaluate docstring coverage. Skipping docstring coverage check.
✨ Finishing touches
  • 📝 Generate docstrings
🧪 Generate unit tests (beta)
  • Create PR with unit tests
  • Post copyable unit tests in a comment
  • Commit unit tests in branch rob/hide-api-keys-user-button

📜 Recent review details

Configuration used: Path: .coderabbit.yaml

Review profile: CHILL

Plan: Pro

Disabled knowledge base sources:

  • Linear integration is disabled by default for public repositories

You can enable these sources in your CodeRabbit configuration.

📥 Commits

Reviewing files that changed from the base of the PR and between e1921ac and 93cd916.

📒 Files selected for processing (4)
  • .changeset/honest-pears-play.md (1 hunks)
  • packages/astro/src/astro-components/interactive/UserButton/UserButton.astro (1 hunks)
  • packages/shared/src/types/clerk.ts (1 hunks)
  • packages/vue/src/components/ui-components/UserButton/UserButton.vue (1 hunks)
🧰 Additional context used
📓 Path-based instructions (5)
**/*.{js,jsx,ts,tsx}

📄 CodeRabbit inference engine (.cursor/rules/development.mdc)

**/*.{js,jsx,ts,tsx}: All code must pass ESLint checks with the project's configuration
Follow established naming conventions (PascalCase for components, camelCase for variables)
Maintain comprehensive JSDoc comments for public APIs
Use dynamic imports for optional features
All public APIs must be documented with JSDoc
Provide meaningful error messages to developers
Include error recovery suggestions where applicable
Log errors appropriately for debugging
Lazy load components and features when possible
Implement proper caching strategies
Use efficient data structures and algorithms
Profile and optimize critical paths
Validate all inputs and sanitize outputs
Implement proper logging with different levels

Files:

  • packages/shared/src/types/clerk.ts
**/*.{js,jsx,ts,tsx,json,css,scss,md,yaml,yml}

📄 CodeRabbit inference engine (.cursor/rules/development.mdc)

Use Prettier for consistent code formatting

Files:

  • packages/shared/src/types/clerk.ts
packages/**/*.{ts,tsx}

📄 CodeRabbit inference engine (.cursor/rules/development.mdc)

TypeScript is required for all packages

Files:

  • packages/shared/src/types/clerk.ts
packages/**/*.{ts,tsx,d.ts}

📄 CodeRabbit inference engine (.cursor/rules/development.mdc)

Packages should export TypeScript types alongside runtime code

Files:

  • packages/shared/src/types/clerk.ts
**/*.{ts,tsx}

📄 CodeRabbit inference engine (.cursor/rules/development.mdc)

Use proper TypeScript error types

**/*.{ts,tsx}: Always define explicit return types for functions, especially public APIs
Use proper type annotations for variables and parameters where inference isn't clear
Avoid any type - prefer unknown when type is uncertain, then narrow with type guards
Use interface for object shapes that might be extended
Use type for unions, primitives, and computed types
Prefer readonly properties for immutable data structures
Use private for internal implementation details
Use protected for inheritance hierarchies
Use public explicitly for clarity in public APIs
Prefer readonly for properties that shouldn't change after construction
Prefer composition and interfaces over deep inheritance chains
Use mixins for shared behavior across unrelated classes
Implement dependency injection for loose coupling
Let TypeScript infer when types are obvious
Use const assertions for literal types: as const
Use satisfies operator for type checking without widening
Use mapped types for transforming object types
Use conditional types for type-level logic
Leverage template literal types for string manipulation
Use ES6 imports/exports consistently
Use default exports sparingly, prefer named exports
Use type-only imports: import type { ... } from ...
No any types without justification
Proper error handling with typed errors
Consistent use of readonly for immutable data
Proper generic constraints
No unused type parameters
Proper use of utility types instead of manual type construction
Type-only imports where possible
Proper tree-shaking friendly exports
No circular dependencies
Efficient type computations (avoid deep recursion)

Files:

  • packages/shared/src/types/clerk.ts
⏰ Context from checks skipped due to timeout of 90000ms. You can increase the timeout in your CodeRabbit configuration to a maximum of 15 minutes (900000ms). (30)
  • GitHub Check: Integration Tests (nextjs, chrome, 14)
  • GitHub Check: Integration Tests (handshake, chrome)
  • GitHub Check: Integration Tests (custom, chrome)
  • GitHub Check: Integration Tests (machine, chrome)
  • GitHub Check: Integration Tests (quickstart, chrome, 16)
  • GitHub Check: Integration Tests (billing, chrome, RQ)
  • GitHub Check: Integration Tests (nextjs, chrome, 15, RQ)
  • GitHub Check: Integration Tests (billing, chrome)
  • GitHub Check: Integration Tests (nuxt, chrome)
  • GitHub Check: Integration Tests (nextjs, chrome, 16)
  • GitHub Check: Integration Tests (nextjs, chrome, 15)
  • GitHub Check: Integration Tests (tanstack-react-start, chrome)
  • GitHub Check: Integration Tests (handshake:staging, chrome)
  • GitHub Check: Integration Tests (expo-web, chrome)
  • GitHub Check: Integration Tests (quickstart, chrome, 15)
  • GitHub Check: Integration Tests (vue, chrome)
  • GitHub Check: Integration Tests (sessions:staging, chrome)
  • GitHub Check: Integration Tests (astro, chrome)
  • GitHub Check: Integration Tests (react-router, chrome)
  • GitHub Check: Integration Tests (sessions, chrome)
  • GitHub Check: Integration Tests (elements, chrome)
  • GitHub Check: Integration Tests (generic, chrome)
  • GitHub Check: Integration Tests (ap-flows, chrome)
  • GitHub Check: Integration Tests (localhost, chrome)
  • GitHub Check: Integration Tests (express, chrome)
  • GitHub Check: Publish with pkg-pr-new
  • GitHub Check: Static analysis
  • GitHub Check: Unit Tests (22, shared, clerk-js, RQ)
  • GitHub Check: Unit Tests (22, **)
  • GitHub Check: semgrep-cloud-platform/scan
🔇 Additional comments (4)
.changeset/honest-pears-play.md (1)

1-7: LGTM! Changeset correctly documents the patch release.

The changeset appropriately documents this as a patch-level fix across the three affected packages.

packages/shared/src/types/clerk.ts (1)

1719-1719: LGTM! Type extension correctly adds apiKeysProps support.

The addition of 'apiKeysProps' to the Pick type correctly enables UserButton to accept API Keys configuration and pass it through to the UserProfile component. This aligns with the existing apiKeysProps definition in UserProfileProps (lines 1567-1574).

packages/vue/src/components/ui-components/UserButton/UserButton.vue (1)

11-11: LGTM! Vue component type correctly extended.

The addition of 'apiKeysProps' to the Pick type is correct. Note that customPages is intentionally excluded here since it's managed separately through the composition API (line 18: useUserProfileCustomPages) and merged into finalProps at line 24.

packages/astro/src/astro-components/interactive/UserButton/UserButton.astro (1)

5-5: LGTM! Astro component type correctly extended.

The addition of 'apiKeysProps' to the Pick type is correct. Similar to Vue, customPages is intentionally excluded here as it's handled through Astro's slot mechanism (line 32: <slot />).

The AI summaries reference changes to React (packages/react/src/components/uiComponents.tsx) that extend UserButtonPropsWithoutCustomPages similarly, but those files weren't provided for review. Please verify that the React implementation has been updated consistently with these changes.


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

@wobsoriano wobsoriano changed the title chore(clerk-js): Allow hiding of API keys page within UserButton chore(react): Allow hiding of API keys page within UserButton Nov 11, 2025
Copy link
Contributor

@coderabbitai coderabbitai bot left a comment

Choose a reason for hiding this comment

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

Actionable comments posted: 0

🧹 Nitpick comments (1)
packages/react/src/components/uiComponents.tsx (1)

82-82: Consider adding JSDoc documentation for the expanded API.

The userProfileProps property now accepts apiKeysProps but lacks documentation explaining its purpose and usage. Consider adding a JSDoc comment to help developers understand how to use this new capability.

Apply this diff to add documentation:

+  /**
+   * Props to pass to the UserProfile component when opened from UserButton.
+   * Now supports `apiKeysProps` to control visibility of the API Keys page.
+   */
   userProfileProps?: Pick<UserProfileProps, 'additionalOAuthScopes' | 'appearance' | 'apiKeysProps'>;

Based on coding guidelines.

📜 Review details

Configuration used: Path: .coderabbit.yaml

Review profile: CHILL

Plan: Pro

Disabled knowledge base sources:

  • Linear integration is disabled by default for public repositories

You can enable these sources in your CodeRabbit configuration.

📥 Commits

Reviewing files that changed from the base of the PR and between 4011c5e and ba43881.

📒 Files selected for processing (1)
  • packages/react/src/components/uiComponents.tsx (1 hunks)
🧰 Additional context used
📓 Path-based instructions (7)
**/*.{js,jsx,ts,tsx}

📄 CodeRabbit inference engine (.cursor/rules/development.mdc)

**/*.{js,jsx,ts,tsx}: All code must pass ESLint checks with the project's configuration
Follow established naming conventions (PascalCase for components, camelCase for variables)
Maintain comprehensive JSDoc comments for public APIs
Use dynamic imports for optional features
All public APIs must be documented with JSDoc
Provide meaningful error messages to developers
Include error recovery suggestions where applicable
Log errors appropriately for debugging
Lazy load components and features when possible
Implement proper caching strategies
Use efficient data structures and algorithms
Profile and optimize critical paths
Validate all inputs and sanitize outputs
Implement proper logging with different levels

Files:

  • packages/react/src/components/uiComponents.tsx
**/*.{js,jsx,ts,tsx,json,css,scss,md,yaml,yml}

📄 CodeRabbit inference engine (.cursor/rules/development.mdc)

Use Prettier for consistent code formatting

Files:

  • packages/react/src/components/uiComponents.tsx
packages/**/*.{ts,tsx}

📄 CodeRabbit inference engine (.cursor/rules/development.mdc)

TypeScript is required for all packages

Files:

  • packages/react/src/components/uiComponents.tsx
packages/**/*.{ts,tsx,d.ts}

📄 CodeRabbit inference engine (.cursor/rules/development.mdc)

Packages should export TypeScript types alongside runtime code

Files:

  • packages/react/src/components/uiComponents.tsx
**/*.{ts,tsx}

📄 CodeRabbit inference engine (.cursor/rules/development.mdc)

Use proper TypeScript error types

**/*.{ts,tsx}: Always define explicit return types for functions, especially public APIs
Use proper type annotations for variables and parameters where inference isn't clear
Avoid any type - prefer unknown when type is uncertain, then narrow with type guards
Use interface for object shapes that might be extended
Use type for unions, primitives, and computed types
Prefer readonly properties for immutable data structures
Use private for internal implementation details
Use protected for inheritance hierarchies
Use public explicitly for clarity in public APIs
Prefer readonly for properties that shouldn't change after construction
Prefer composition and interfaces over deep inheritance chains
Use mixins for shared behavior across unrelated classes
Implement dependency injection for loose coupling
Let TypeScript infer when types are obvious
Use const assertions for literal types: as const
Use satisfies operator for type checking without widening
Use mapped types for transforming object types
Use conditional types for type-level logic
Leverage template literal types for string manipulation
Use ES6 imports/exports consistently
Use default exports sparingly, prefer named exports
Use type-only imports: import type { ... } from ...
No any types without justification
Proper error handling with typed errors
Consistent use of readonly for immutable data
Proper generic constraints
No unused type parameters
Proper use of utility types instead of manual type construction
Type-only imports where possible
Proper tree-shaking friendly exports
No circular dependencies
Efficient type computations (avoid deep recursion)

Files:

  • packages/react/src/components/uiComponents.tsx
**/*.{jsx,tsx}

📄 CodeRabbit inference engine (.cursor/rules/development.mdc)

**/*.{jsx,tsx}: Use error boundaries in React components
Minimize re-renders in React components

**/*.{jsx,tsx}: Always use functional components with hooks instead of class components
Follow PascalCase naming for components: UserProfile, NavigationMenu
Keep components focused on a single responsibility - split large components
Limit component size to 150-200 lines; extract logic into custom hooks
Use composition over inheritance - prefer smaller, composable components
Export components as named exports for better tree-shaking
One component per file with matching filename and component name
Use useState for simple state management
Use useReducer for complex state logic
Implement proper state initialization
Use proper state updates with callbacks
Implement proper state cleanup
Use Context API for theme/authentication
Implement proper state selectors
Use proper state normalization
Implement proper state persistence
Use React.memo for expensive components
Implement proper useCallback for handlers
Use proper useMemo for expensive computations
Implement proper virtualization for lists
Use proper code splitting with React.lazy
Implement proper cleanup in useEffect
Use proper refs for DOM access
Implement proper event listener cleanup
Use proper abort controllers for fetch
Implement proper subscription cleanup
Use proper HTML elements
Implement proper ARIA attributes
Use proper heading hierarchy
Implement proper form labels
Use proper button types
Implement proper focus management
Use proper keyboard shortcuts
Implement proper tab order
Use proper skip links
Implement proper focus traps
Implement proper error boundaries
Use proper error logging
Implement proper error recovery
Use proper error messages
Implement proper error fallbacks
Use proper form validation
Implement proper error states
Use proper error messages
Implement proper form submission
Use proper form reset
Use proper component naming
Implement proper file naming
Use proper prop naming
Implement proper...

Files:

  • packages/react/src/components/uiComponents.tsx
**/*.tsx

📄 CodeRabbit inference engine (.cursor/rules/react.mdc)

**/*.tsx: Use proper type definitions for props and state
Leverage TypeScript's type inference where possible
Use proper event types for handlers
Implement proper generic types for reusable components
Use proper type guards for conditional rendering

Files:

  • packages/react/src/components/uiComponents.tsx
⏰ Context from checks skipped due to timeout of 90000ms. You can increase the timeout in your CodeRabbit configuration to a maximum of 15 minutes (900000ms). (5)
  • GitHub Check: Build Packages
  • GitHub Check: Formatting | Dedupe | Changeset
  • GitHub Check: semgrep-cloud-platform/scan
  • GitHub Check: semgrep-cloud-platform/scan
  • GitHub Check: Analyze (javascript-typescript)
🔇 Additional comments (1)
packages/react/src/components/uiComponents.tsx (1)

82-82: ✅ Type change verified—no issues found.

The apiKeysProps property is properly defined on UserProfileProps at packages/shared/src/types/clerk.ts:1567, and the change is confirmed to be working throughout the codebase with existing runtime usage in UserProfileRoutes, UserProfileNavbar, and related components. The addition to the Pick union at line 82 is a valid, non-breaking type expansion that exposes already-functional capability.

@pkg-pr-new
Copy link

pkg-pr-new bot commented Nov 11, 2025

Open in StackBlitz

@clerk/agent-toolkit

npm i https://pkg.pr.new/@clerk/agent-toolkit@7201

@clerk/astro

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

@clerk/backend

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

@clerk/chrome-extension

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

@clerk/clerk-js

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

@clerk/dev-cli

npm i https://pkg.pr.new/@clerk/dev-cli@7201

@clerk/elements

npm i https://pkg.pr.new/@clerk/elements@7201

@clerk/clerk-expo

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

@clerk/expo-passkeys

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

@clerk/express

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

@clerk/fastify

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

@clerk/localizations

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

@clerk/nextjs

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

@clerk/nuxt

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

@clerk/clerk-react

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

@clerk/react-router

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

@clerk/remix

npm i https://pkg.pr.new/@clerk/remix@7201

@clerk/shared

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

@clerk/tanstack-react-start

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

@clerk/testing

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

@clerk/themes

npm i https://pkg.pr.new/@clerk/themes@7201

@clerk/types

npm i https://pkg.pr.new/@clerk/types@7201

@clerk/upgrade

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

@clerk/vue

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

commit: 93cd916

@wobsoriano wobsoriano changed the title chore(react): Allow hiding of API keys page within UserButton chore(clerk-react): Allow hiding of API keys page within UserButton Nov 11, 2025
@wobsoriano wobsoriano changed the title chore(clerk-react): Allow hiding of API keys page within UserButton chore(clerk-react): Allow hiding of UserProfile API keys page within UserButton Nov 11, 2025
@wobsoriano wobsoriano changed the title chore(clerk-react): Allow hiding of UserProfile API keys page within UserButton chore(clerk-react,vue,astro): Allow hiding of UserProfile API keys page within UserButton Nov 11, 2025
@wobsoriano wobsoriano merged commit 791e942 into main Nov 11, 2025
45 checks passed
@wobsoriano wobsoriano deleted the rob/hide-api-keys-user-button branch November 11, 2025 23:48
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Projects

None yet

Development

Successfully merging this pull request may close these issues.

4 participants