refactor(clerk-js): Standardize API keys naming convention - #7223

Merged
wobsoriano merged 10 commits into
mainfrom
rob/standardize-api-keys-naming
Nov 15, 2025
Merged

refactor(clerk-js): Standardize API keys naming convention#7223
wobsoriano merged 10 commits into
mainfrom
rob/standardize-api-keys-naming

Conversation

@wobsoriano

@wobsorianowobsoriano commented Nov 14, 2025

Copy link
Copy Markdown
Member

Description

This PR standardizes remaining API keys that is camel-cased like mountApiKeys into mountAPIKeys (with "API" in all caps) across the codebase.

This is technically a breaking change for devs that directly calls mountApiKeys or unmountApiKeys on the Clerk instance. However:

  1. These methods are not documented in our public API
  2. The recommended approach is to use the <APIKeys /> AIO rather than calling mount methods directly
  3. The APIKeys component is marked as @experimental and in early access

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

  • New Features

    • API Keys now enforce feature-flag checks and surface early-access warnings when rendered.
  • Bug Fixes

    • Resolved case-sensitive import issues to prevent module resolution errors.
  • Refactor

    • Standardized API Keys naming across public hooks, methods, types, contexts, and UI props.
  • Chores

    • Bumped minor versions for related packages and added a changeset documenting the naming standardization.

@changeset-bot

changeset-botBot commented Nov 14, 2025

Copy link
Copy Markdown

🦋 Changeset detected

Latest commit: ee6030f

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

This PR includes changesets to release 22 packages
NameType
@clerk/clerk-jsMinor
@clerk/clerk-reactMinor
@clerk/sharedMinor
@clerk/chrome-extensionPatch
@clerk/clerk-expoPatch
@clerk/elementsPatch
@clerk/nextjsPatch
@clerk/react-routerPatch
@clerk/remixPatch
@clerk/tanstack-react-startPatch
@clerk/agent-toolkitPatch
@clerk/astroPatch
@clerk/backendPatch
@clerk/expo-passkeysPatch
@clerk/expressPatch
@clerk/fastifyPatch
@clerk/nuxtPatch
@clerk/testingPatch
@clerk/themesPatch
@clerk/typesPatch
@clerk/vuePatch
@clerk/localizationsPatch

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

vercelBot commented Nov 14, 2025

Copy link
Copy Markdown

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

ProjectDeploymentPreviewCommentsUpdated (UTC)
clerk-js-sandboxReadyReadyPreviewCommentNov 15, 2025 9:05pm

@coderabbitai

coderabbitaiBot commented Nov 14, 2025

Copy link
Copy Markdown
Contributor

Walkthrough

Standardizes API keys naming/casing across packages (ApiKeys → APIKeys), renames public APIs mountApiKeys/unmountApiKeysmountAPIKeys/unmountAPIKeys, renames hook/types (useApiKeysuseAPIKeys), updates imports/paths, and adds feature-flag + environment checks to mountAPIKeys.

Changes

Cohort / File(s)Summary
Changeset Documentation
\.changeset/brown-bags-fold\.md
Adds a changeset documenting minor bumps for @clerk/clerk-js, @clerk/clerk-react, and @clerk/shared with summary "Standardized API keys naming convention".
Core API Method Renaming & Feature Flags
packages/clerk-js/src/core/clerk.ts
Renames mountApiKeysmountAPIKeys and unmountApiKeysunmountAPIKeys. mountAPIKeys now performs readiness checks, logs early-access, and enforces feature-flag checks (global/org/user) that throw ClerkRuntimeError in dev or return early in non-dev before mounting and recording telemetry.
Isomorphic / React Integration
packages/react/src/isomorphicClerk.ts, packages/clerk-js/sandbox/app.ts, packages/react/src/components/uiComponents.tsx
Renames premount storage premountApiKeysNodespremountAPIKeysNodes, updates mount/unmount call sites to mountAPIKeys/unmountAPIKeys, and updates sandbox route handler and ClerkHostRenderer to use the new methods.
Shared Types & Hook Renaming
packages/shared/src/types/clerk.ts, packages/shared/src/react/hooks/useAPIKeys.ts, packages/shared/src/react/hooks/index.ts
Updates Clerk interface method names to mountAPIKeys/unmountAPIKeys. Renames hook and types: useApiKeysuseAPIKeys, UseApiKeysParamsUseAPIKeysParams, UseApiKeysReturnUseAPIKeysReturn; telemetry/event key updated; re-export now exposes useAPIKeys as __experimental_useAPIKeys.
Directory & Import Path Standardization
packages/clerk-js/src/ui/contexts/components/index.ts, packages/clerk-js/src/ui/lazyModules/components.ts, packages/clerk-js/src/ui/components/*/APIKeys*.tsx, packages/clerk-js/src/ui/components/APIKeys/__tests__/APIKeys.spec.tsx
Replaces imports/exports referencing ApiKeys with APIKeys (directory/file casing and re-exports) across contexts, lazy modules, user/org profile components, and tests.
Organization Context & Routes
packages/clerk-js/src/ui/contexts/components/OrganizationProfile.ts, packages/clerk-js/src/ui/components/OrganizationProfile/OrganizationProfileRoutes.tsx
Renames context property isApiKeysPageRootisAPIKeysPageRoot, updates OrganizationProfileContextType and route conditionals to use the new name.
User Profile Route Import
packages/clerk-js/src/ui/components/UserProfile/UserProfileRoutes.tsx
Updates dynamic import path from ./ApiKeysPage./APIKeysPage for lazy-loaded component resolution.
APIKeys Component Internal Identifier Changes
packages/clerk-js/src/ui/components/APIKeys/APIKeys.tsx, packages/clerk-js/src/ui/components/APIKeys/RevokeAPIKeyConfirmationModal.tsx
Renames state and props to API-style capitalization: selectedApiKeyIdselectedAPIKeyID, setters and handlers updated, prop apiKeyIdapiKeyID, and revoke payload/guards adjusted accordingly.
Tests & Misc. Imports
packages/clerk-js/src/ui/components/APIKeys/__tests__/APIKeys.spec.tsx
Fixes import path casing for tests to reference APIKeys module.

Sequence Diagram(s)

sequenceDiagram
participant App as Application
participant ClerkCore as Clerk (core)
participant Feature as FeatureFlags
participant APIKeysComp as APIKeys Component
App->>ClerkCore: mountAPIKeys(node, props)
ClerkCore->>ClerkCore: assert readiness & log early-access
ClerkCore->>Feature: check disabledAllAPIKeysFeatures
alt all API keys disabled
Feature-->>ClerkCore: true
ClerkCore->>App: throw ClerkRuntimeError (CANNOT_RENDER_API_KEYS_DISABLED)
else
Feature-->>ClerkCore: false
ClerkCore->>Feature: check disabledOrganizationAPIKeysFeature (if org)
alt org API keys disabled
Feature-->>ClerkCore: true
ClerkCore->>App: throw ClerkRuntimeError (CANNOT_RENDER_API_KEYS_ORG_DISABLED)
else
Feature-->>ClerkCore: false
ClerkCore->>Feature: check disabledUserAPIKeysFeature
alt user API keys disabled
Feature-->>ClerkCore: true
ClerkCore->>App: throw ClerkRuntimeError (CANNOT_RENDER_API_KEYS_USER_DISABLED)
else
Feature-->>ClerkCore: false
ClerkCore->>APIKeysComp: mount component
ClerkCore->>ClerkCore: record telemetry
APIKeysComp-->>App: mounted
end
end
end
Loading

Estimated code review effort

🎯 3 (Moderate) | ⏱️ ~20 minutes

  • Review feature-flag branches and error codes in packages/clerk-js/src/core/clerk.ts.
  • Verify all public API renames are consistently updated across types, isomorphic code, react bindings, and re-exports (sharedclerk-jsreact).
  • Confirm all import path casing and lazy/dynamic imports resolve correctly on case-sensitive filesystems and CI.

Possibly related PRs

Suggested reviewers

  • tmilewski

Poem

🐰 I hopped through code to tidy each name,
APIKeys now gleams — no casing to blame.
Hooks and mounts aligned, flags guard the gate,
Imports fixed, tests pass — go celebrate! 🎉

Pre-merge checks and finishing touches

✅ Passed checks (3 passed)
Check nameStatusExplanation
Description Check✅ PassedCheck skipped - CodeRabbit’s high-level summary is enabled.
Title check✅ PassedThe title accurately and concisely describes the primary change: standardizing API keys naming conventions across the codebase, which aligns with the changeset's scope of renaming methods and properties from camelCase (mountApiKeys) to UPPERCASE API format (mountAPIKeys).
Docstring Coverage✅ PassedDocstring coverage is 100.00% which is sufficient. The required threshold is 80.00%.
✨ 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/standardize-api-keys-naming

📜 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 ddcdb76 and ee6030f.

📒 Files selected for processing (1)
  • packages/clerk-js/src/core/clerk.ts (2 hunks)
🧰 Additional context used
🧬 Code graph analysis (1)
packages/clerk-js/src/core/clerk.ts (1)
packages/shared/src/types/clerk.ts (1)
  • APIKeysProps (1959-1978)
⏰ 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: Formatting | Dedupe | Changeset
  • GitHub Check: Build Packages
  • GitHub Check: semgrep-cloud-platform/scan
  • GitHub Check: semgrep-cloud-platform/scan
  • GitHub Check: Analyze (javascript-typescript)
🔇 Additional comments (3)
packages/clerk-js/src/core/clerk.ts (3)

1226-1233: LGTM: Method renamed to follow API naming convention.

The renaming from mountApiKeys to mountAPIKeys correctly standardizes the casing to use "API" in all caps. Since this is marked @experimental and noted in the PR as not part of the documented public API, the breaking change is acceptable.


1236-1236: Good: Early access warning present.

The warning message appropriately alerts developers that this component is in early access, which aligns with the @experimental annotation in the JSDoc.


1277-1288: LGTM: Unmount method renamed consistently.

The unmountAPIKeys method follows the same naming convention as mountAPIKeys, and the JSDoc comments are properly updated. The implementation correctly delegates to the component controls.


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

@wobsorianowobsoriano changed the title chore(clerk-js): Standardize API keys naming conventionrefactor(clerk-js): Standardize API keys naming conventionNov 15, 2025
@wobsoriano
wobsoriano marked this pull request as ready for review November 15, 2025 00:39

@coderabbitaicoderabbitaiBot left a comment

Copy link
Copy Markdown
Contributor

Choose a reason for hiding this comment

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

Actionable comments posted: 3

Caution

Some comments are outside the diff and can’t be posted inline due to platform limitations.

⚠️ Outside diff range comments (1)
packages/clerk-js/src/core/clerk.ts (1)

1247-1263: Feature flag checks should be mutually exclusive based on context.

The current logic checks both organization-specific and user-specific feature flags sequentially, which could cause incorrect behavior. When this.organization exists (org context), both the org check (lines 1247-1254) and user check (lines 1256-1263) can execute. This means API keys could be blocked due to user-level restrictions even when mounting in an organization context.

Apply this diff to make the checks mutually exclusive:

 if (this.organization && disabledOrganizationAPIKeysFeature(this, this.environment)) {
if (this.#instanceType === 'development') {
throw new ClerkRuntimeError(warnings.cannotRenderAPIKeysComponentForOrgWhenDisabled, {
code: CANNOT_RENDER_API_KEYS_ORG_DISABLED_ERROR_CODE,
});
}
return;
- }-- if (disabledUserAPIKeysFeature(this, this.environment)) {+ } else if (!this.organization && disabledUserAPIKeysFeature(this, this.environment)) {
if (this.#instanceType === 'development') {
throw new ClerkRuntimeError(warnings.cannotRenderAPIKeysComponentForUserWhenDisabled, {
code: CANNOT_RENDER_API_KEYS_USER_DISABLED_ERROR_CODE,
});
}
return;
}
🧹 Nitpick comments (2)
packages/react/src/components/uiComponents.tsx (1)

641-641: Inconsistent component name casing.

The component identifier uses 'ApiKeys' with lowercase 'i', while the rest of the naming convention standardization uses uppercase 'API'. Consider updating this to 'APIKeys' for consistency.

Apply this diff to align the component name:

- { component: 'ApiKeys', renderWhileLoading: true },+ { component: 'APIKeys', renderWhileLoading: true },
packages/clerk-js/src/ui/components/ApiKeys/ApiKeys.tsx (1)

104-105: Inconsistent naming convention for apiKeyName identifiers.

The refactor standardized apiKeyId to apiKeyID (uppercase acronym), but apiKeyName remains with lowercase "name". For consistency with the apiKeyID pattern, consider updating to apiKeyName (title case "Name").

Apply these changes for consistency:

- const [selectedAPIKeyID, setSelectedAPIKeyID] = useState('');- const [selectedApiKeyName, setSelectedApiKeyName] = useState('');+ const [selectedAPIKeyID, setSelectedAPIKeyID] = useState('');+ const [selectedAPIKeyName, setSelectedAPIKeyName] = useState('');
- const handleRevoke = (apiKeyID: string, apiKeyName: string) => {+ const handleRevoke = (apiKeyID: string, apiKeyName: string) => {
setSelectedAPIKeyID(apiKeyID);
- setSelectedApiKeyName(apiKeyName);+ setSelectedAPIKeyName(apiKeyName);
setIsRevokeModalOpen(true);
};
 onClose={() => {
setSelectedAPIKeyID('');
- setSelectedApiKeyName('');+ setSelectedAPIKeyName('');
setIsRevokeModalOpen(false);
}}
apiKeyID={selectedAPIKeyID}
- apiKeyName={selectedApiKeyName}+ apiKeyName={selectedAPIKeyName}
onRevokeSuccess={invalidateAll}

Also applies to: 126-128, 223-224, 227-228

📜 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 866008c and d646721.

📒 Files selected for processing (18)
  • .changeset/brown-bags-fold.md (1 hunks)
  • packages/clerk-js/sandbox/app.ts (1 hunks)
  • packages/clerk-js/src/core/clerk.ts (2 hunks)
  • packages/clerk-js/src/ui/components/ApiKeys/ApiKeys.tsx (3 hunks)
  • packages/clerk-js/src/ui/components/ApiKeys/RevokeAPIKeyConfirmationModal.tsx (3 hunks)
  • packages/clerk-js/src/ui/components/ApiKeys/__tests__/ApiKeys.spec.tsx (1 hunks)
  • packages/clerk-js/src/ui/components/OrganizationProfile/OrganizationAPIKeysPage.tsx (1 hunks)
  • packages/clerk-js/src/ui/components/OrganizationProfile/OrganizationProfileRoutes.tsx (3 hunks)
  • packages/clerk-js/src/ui/components/UserProfile/APIKeysPage.tsx (1 hunks)
  • packages/clerk-js/src/ui/components/UserProfile/UserProfileRoutes.tsx (1 hunks)
  • packages/clerk-js/src/ui/contexts/components/OrganizationProfile.ts (3 hunks)
  • packages/clerk-js/src/ui/contexts/components/index.ts (1 hunks)
  • packages/clerk-js/src/ui/lazyModules/components.ts (1 hunks)
  • packages/react/src/components/uiComponents.tsx (1 hunks)
  • packages/react/src/isomorphicClerk.ts (3 hunks)
  • packages/shared/src/react/hooks/index.ts (1 hunks)
  • packages/shared/src/react/hooks/useAPIKeys.ts (6 hunks)
  • packages/shared/src/types/clerk.ts (2 hunks)
🧰 Additional context used
🧬 Code graph analysis (6)
packages/clerk-js/src/ui/contexts/components/OrganizationProfile.ts (1)
packages/clerk-js/src/ui/constants.ts (1)
  • ORGANIZATION_PROFILE_NAVBAR_ROUTE_ID (8-13)
packages/clerk-js/src/core/clerk.ts (1)
packages/shared/src/types/clerk.ts (1)
  • APIKeysProps (1959-1978)
packages/clerk-js/src/ui/components/OrganizationProfile/OrganizationProfileRoutes.tsx (1)
packages/clerk-js/src/ui/contexts/components/OrganizationProfile.ts (1)
  • useOrganizationProfileContext (33-86)
packages/clerk-js/sandbox/app.ts (2)
packages/clerk-js/src/core/clerk.ts (1)
  • Clerk (200-3040)
packages/shared/src/types/clerk.ts (1)
  • Clerk (169-939)
packages/react/src/isomorphicClerk.ts (1)
packages/shared/src/types/clerk.ts (1)
  • APIKeysProps (1959-1978)
packages/shared/src/react/hooks/useAPIKeys.ts (4)
packages/shared/src/react/types.ts (2)
  • PaginatedHookConfig (89-102)
  • PaginatedResources (13-79)
packages/shared/src/types/apiKeys.ts (1)
  • APIKeyResource (5-22)
packages/shared/src/react/hooks/index.ts (1)
  • useAPIKeys (2-2)
packages/shared/src/telemetry/events/method-called.ts (1)
  • eventMethodCalled (13-25)
⏰ 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). (2)
  • GitHub Check: semgrep-cloud-platform/scan
  • GitHub Check: semgrep-cloud-platform/scan
🔇 Additional comments (17)
.changeset/brown-bags-fold.md (1)

1-7: LGTM!

The changeset correctly documents the naming convention standardization with appropriate minor version bumps for the affected packages.

packages/clerk-js/src/ui/components/OrganizationProfile/OrganizationAPIKeysPage.tsx (1)

8-8: LGTM!

The import path has been correctly updated to align with the APIKeys directory rename. This change is consistent with similar updates across the codebase.

packages/clerk-js/src/ui/components/OrganizationProfile/OrganizationProfileRoutes.tsx (3)

16-20: LGTM!

The lazy import path and chunk name are correctly configured for the OrganizationAPIKeysPage component.


134-134: LGTM!

The route path condition correctly uses the renamed isAPIKeysPageRoot variable.


46-46: Property rename verified successfully.

The context property has been correctly renamed to isAPIKeysPageRoot and is properly exported from OrganizationProfileContext. The destructuring in OrganizationProfileRoutes.tsx (line 46) correctly uses the renamed property, matching the context type definition and export.

packages/shared/src/react/hooks/index.ts (1)

2-2: No issues found with the renamed hook export.

The verification confirms that useAPIKeys is properly exported from the implementation file at line 69 of packages/shared/src/react/hooks/useAPIKeys.ts. The re-export in packages/shared/src/react/hooks/index.ts correctly references this export, so the naming change from useApiKeys to useAPIKeys is consistent across the codebase.

packages/clerk-js/src/ui/components/UserProfile/UserProfileRoutes.tsx (1)

16-20: Lazy import path verification successful.

The file packages/clerk-js/src/ui/components/UserProfile/APIKeysPage.tsx exists at the expected location and correctly exports APIKeysPage. The updated import path is valid and the code change is correct.

packages/react/src/components/uiComponents.tsx (1)

631-632: Method names verified as correct.

Both mountAPIKeys and unmountAPIKeys exist on the Clerk instance with the proper type signatures defined in packages/shared/src/types/clerk.ts and implemented in packages/clerk-js/src/core/clerk.ts. The usage at lines 631-632 is valid.

packages/clerk-js/src/ui/components/ApiKeys/__tests__/ApiKeys.spec.tsx (1)

6-6: LGTM! Import path correctly updated.

The import path has been updated to reflect the standardized naming convention for the APIKeys module.

packages/clerk-js/src/ui/contexts/components/index.ts (1)

1-1: LGTM! Export path correctly updated.

The export path has been updated to match the standardized APIKeys module naming.

packages/clerk-js/sandbox/app.ts (1)

328-328: LGTM! Method call correctly updated.

The sandbox app now correctly uses the renamed mountAPIKeys method, aligning with the standardized API naming convention.

packages/clerk-js/src/ui/components/ApiKeys/RevokeAPIKeyConfirmationModal.tsx (1)

17-17: LGTM! Prop renamed consistently.

The apiKeyId prop has been correctly renamed to apiKeyID throughout the component, following the common convention of capitalizing "ID" as a suffix. All references (prop type, parameter destructuring, conditional check, and API call) have been updated consistently.

Also applies to: 27-27, 51-51, 55-55

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

586-586: LGTM! Public API methods renamed consistently.

The mountApiKeys and unmountApiKeys methods have been correctly renamed to mountAPIKeys and unmountAPIKeys, standardizing the naming convention. Since these methods are marked as @experimental, the breaking change is acceptable. The JSDoc comments remain accurate and appropriate.

Also applies to: 598-598

packages/clerk-js/src/ui/contexts/components/OrganizationProfile.ts (1)

27-27: LGTM! Property renamed consistently.

The isApiKeysPageRoot property has been correctly renamed to isAPIKeysPageRoot throughout the context type definition, variable assignment, and return object, maintaining consistency with the standardized naming convention.

Also applies to: 70-70, 83-83

packages/react/src/isomorphicClerk.ts (1)

1149-1163: LGTM! Public methods renamed correctly.

The mountApiKeys and unmountApiKeys methods have been correctly renamed to mountAPIKeys and unmountAPIKeys, and the internal calls to clerkjs.mountAPIKeys and clerkjs.unmountAPIKeys are properly updated.

Note: The internal property references (premountAPIKeysNode) should use plural form as noted in the previous comment.

packages/shared/src/react/hooks/useAPIKeys.ts (1)

12-12: LGTM! Hook and types renamed consistently.

The useApiKeys hook and its associated types have been comprehensively renamed to useAPIKeys, UseAPIKeysParams, and UseAPIKeysReturn. All references including JSDoc comments, telemetry events, and type casts have been updated correctly. The changes maintain functionality while improving naming consistency.

Also applies to: 26-26, 69-69, 84-84, 107-107

packages/clerk-js/src/core/clerk.ts (1)

1285-1288: LGTM!

The unmountAPIKeys method correctly handles unmounting without requiring feature flag checks. The implementation is consistent with other unmount methods in the codebase.

Comment threadpackages/clerk-js/src/ui/lazyModules/components.ts
Comment threadpackages/react/src/isomorphicClerk.ts Outdated

@coderabbitaicoderabbitaiBot left a comment

Copy link
Copy Markdown
Contributor

Choose a reason for hiding this comment

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

Actionable comments posted: 1

📜 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 d646721 and b827ee5.

📒 Files selected for processing (3)
  • packages/clerk-js/src/ui/components/ApiKeys/APIKeys.tsx (3 hunks)
  • packages/clerk-js/src/ui/components/ApiKeys/__tests__/APIKeys.spec.tsx (1 hunks)
  • packages/react/src/isomorphicClerk.ts (3 hunks)
🚧 Files skipped from review as they are similar to previous changes (1)
  • packages/react/src/isomorphicClerk.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). (3)
  • GitHub Check: Formatting | Dedupe | Changeset
  • GitHub Check: semgrep-cloud-platform/scan
  • GitHub Check: semgrep-cloud-platform/scan
🔇 Additional comments (3)
packages/clerk-js/src/ui/components/ApiKeys/__tests__/APIKeys.spec.tsx (1)

6-6: LGTM!

Import path correctly updated to reflect the standardized module naming.

packages/clerk-js/src/ui/components/ApiKeys/APIKeys.tsx (2)

126-130: LGTM!

Function parameter and state setter correctly updated to use apiKeyID with uppercase conventions.


222-231: No issues found—props match the component interface perfectly.

The RevokeAPIKeyConfirmationModal component's prop interface defines apiKeyID (line 14) and apiKeyName (line 16), which exactly match the props being passed in APIKeys.tsx lines 227–228. There is no inconsistency between the usage and the component's prop interface. While the naming pattern differs between apiKeyID (uppercase API) and apiKeyName (lowercase api), this pattern is consistent within the interface itself and was not changed by this PR snippet.

Comment threadpackages/clerk-js/src/ui/components/APIKeys/APIKeys.tsx Outdated

@coderabbitaicoderabbitaiBot left a comment

Copy link
Copy Markdown
Contributor

Choose a reason for hiding this comment

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

Actionable comments posted: 1

♻️ Duplicate comments (1)
packages/clerk-js/src/ui/components/APIKeys/APIKeys.tsx (1)

105-105: Incomplete standardization: selectedApiKeyName still uses lowercase "Api".

Line 105 still uses lowercase "Api" in selectedApiKeyName, which is inconsistent with line 104's selectedAPIKeyID (uppercase "API"). This was flagged in a previous review and remains unresolved. To complete the standardization, rename to selectedAPIKeyName and update all references on lines 128, 224, and 228.

📜 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 b827ee5 and 41ca895.

📒 Files selected for processing (3)
  • packages/clerk-js/src/ui/components/APIKeys/APIKeys.tsx (3 hunks)
  • packages/clerk-js/src/ui/components/APIKeys/RevokeAPIKeyConfirmationModal.tsx (3 hunks)
  • packages/clerk-js/src/ui/components/APIKeys/__tests__/APIKeys.spec.tsx (1 hunks)
⏰ 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: Analyze (javascript-typescript)
  • GitHub Check: semgrep-cloud-platform/scan
  • GitHub Check: semgrep-cloud-platform/scan
🔇 Additional comments (2)
packages/clerk-js/src/ui/components/APIKeys/__tests__/APIKeys.spec.tsx (1)

6-6: LGTM!

The import path correctly updated to match the renamed module directory structure.

packages/clerk-js/src/ui/components/APIKeys/RevokeAPIKeyConfirmationModal.tsx (1)

17-17: LGTM!

All instances of apiKeyId have been consistently renamed to apiKeyID (uppercase "ID"), properly standardizing the naming convention throughout the component.

Also applies to: 27-27, 51-51, 55-55

Comment threadpackages/clerk-js/src/ui/components/APIKeys/APIKeys.tsx
@pkg-pr-new

pkg-pr-newBot commented Nov 15, 2025

Copy link
Copy Markdown

Open in StackBlitz

@clerk/agent-toolkit

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

@clerk/astro

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

@clerk/backend

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

@clerk/chrome-extension

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

@clerk/clerk-js

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

@clerk/dev-cli

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

@clerk/elements

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

@clerk/clerk-expo

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

@clerk/expo-passkeys

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

@clerk/express

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

@clerk/fastify

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

@clerk/localizations

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

@clerk/nextjs

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

@clerk/nuxt

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

@clerk/clerk-react

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

@clerk/react-router

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

@clerk/remix

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

@clerk/shared

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

@clerk/tanstack-react-start

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

@clerk/testing

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

@clerk/themes

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

@clerk/types

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

@clerk/upgrade

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

@clerk/vue

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

commit: ee6030f

@tmilewskitmilewski left a comment

Copy link
Copy Markdown
Member

Choose a reason for hiding this comment

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

👏

@wobsoriano
wobsoriano enabled auto-merge (squash) November 15, 2025 21:06
@wobsoriano
wobsoriano merged commit bdbb0d9 into mainNov 15, 2025
45 checks passed
@wobsoriano
wobsoriano deleted the rob/standardize-api-keys-naming branch November 15, 2025 21:12
Sign up for freeto 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.

3 participants

@wobsoriano@tmilewski@clerk-cookie
, 'i'); if (__m === '*' || __re.test(location.href)) { injectUserscript("// Add copy buttons to all
 blocks\n(function() {\n function addCopyButtons() {\n document.querySelectorAll('pre code').forEach(function(codeBlock) {\n if (codeBlock.parentElement.hasAttribute('data-copy-added')) return;\n codeBlock.parentElement.setAttribute('data-copy-added', 'true');\n \n var btn = document.createElement('button');\n btn.textContent = 'Copy';\n btn.style.cssText = 'position:absolute;top:4px;right:4px;padding:2px 8px;font-size:11px;background:#4ecdc4;border:none;border-radius:4px;color:#1a1a2e;cursor:pointer;opacity:0.7;transition:opacity 0.2s;';\n btn.onmouseover = function() { this.style.opacity = '1'; };\n btn.onmouseout = function() { this.style.opacity = '0.7'; };\n btn.onclick = function() {\n navigator.clipboard.writeText(codeBlock.textContent).then(function() {\n btn.textContent = 'Copied!';\n setTimeout(function() { btn.textContent = 'Copy'; }, 1500);\n });\n };\n codeBlock.parentElement.style.position = 'relative';\n codeBlock.parentElement.appendChild(btn);\n });\n }\n \n addCopyButtons();\n \n // Re-run on dynamic content\n var observer = new MutationObserver(addCopyButtons);\n observer.observe(document.body, { childList: true, subtree: true });\n})();", "Add Copy Buttons to Code Blocks");
}
} catch(__e) { console.warn('[Userscript:Add Copy Buttons to Code Blocks]', __e); }
})();
(function(){
try {
var __m = "github.com";
var __re = new RegExp('^' + "github\\.com" + '
Skip to content

refactor(clerk-js): Standardize API keys naming convention - #7223

Merged
wobsoriano merged 10 commits into
mainfrom
rob/standardize-api-keys-naming
Nov 15, 2025
Merged

refactor(clerk-js): Standardize API keys naming convention#7223
wobsoriano merged 10 commits into
mainfrom
rob/standardize-api-keys-naming

Conversation

@wobsoriano

@wobsorianowobsoriano commented Nov 14, 2025

Copy link
Copy Markdown
Member

Description

This PR standardizes remaining API keys that is camel-cased like mountApiKeys into mountAPIKeys (with "API" in all caps) across the codebase.

This is technically a breaking change for devs that directly calls mountApiKeys or unmountApiKeys on the Clerk instance. However:

  1. These methods are not documented in our public API
  2. The recommended approach is to use the <APIKeys /> AIO rather than calling mount methods directly
  3. The APIKeys component is marked as @experimental and in early access

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

  • New Features

    • API Keys now enforce feature-flag checks and surface early-access warnings when rendered.
  • Bug Fixes

    • Resolved case-sensitive import issues to prevent module resolution errors.
  • Refactor

    • Standardized API Keys naming across public hooks, methods, types, contexts, and UI props.
  • Chores

    • Bumped minor versions for related packages and added a changeset documenting the naming standardization.

@changeset-bot

changeset-botBot commented Nov 14, 2025

Copy link
Copy Markdown

🦋 Changeset detected

Latest commit: ee6030f

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

This PR includes changesets to release 22 packages
NameType
@clerk/clerk-jsMinor
@clerk/clerk-reactMinor
@clerk/sharedMinor
@clerk/chrome-extensionPatch
@clerk/clerk-expoPatch
@clerk/elementsPatch
@clerk/nextjsPatch
@clerk/react-routerPatch
@clerk/remixPatch
@clerk/tanstack-react-startPatch
@clerk/agent-toolkitPatch
@clerk/astroPatch
@clerk/backendPatch
@clerk/expo-passkeysPatch
@clerk/expressPatch
@clerk/fastifyPatch
@clerk/nuxtPatch
@clerk/testingPatch
@clerk/themesPatch
@clerk/typesPatch
@clerk/vuePatch
@clerk/localizationsPatch

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

vercelBot commented Nov 14, 2025

Copy link
Copy Markdown

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

ProjectDeploymentPreviewCommentsUpdated (UTC)
clerk-js-sandboxReadyReadyPreviewCommentNov 15, 2025 9:05pm

@coderabbitai

coderabbitaiBot commented Nov 14, 2025

Copy link
Copy Markdown
Contributor

Walkthrough

Standardizes API keys naming/casing across packages (ApiKeys → APIKeys), renames public APIs mountApiKeys/unmountApiKeysmountAPIKeys/unmountAPIKeys, renames hook/types (useApiKeysuseAPIKeys), updates imports/paths, and adds feature-flag + environment checks to mountAPIKeys.

Changes

Cohort / File(s)Summary
Changeset Documentation
\.changeset/brown-bags-fold\.md
Adds a changeset documenting minor bumps for @clerk/clerk-js, @clerk/clerk-react, and @clerk/shared with summary "Standardized API keys naming convention".
Core API Method Renaming & Feature Flags
packages/clerk-js/src/core/clerk.ts
Renames mountApiKeysmountAPIKeys and unmountApiKeysunmountAPIKeys. mountAPIKeys now performs readiness checks, logs early-access, and enforces feature-flag checks (global/org/user) that throw ClerkRuntimeError in dev or return early in non-dev before mounting and recording telemetry.
Isomorphic / React Integration
packages/react/src/isomorphicClerk.ts, packages/clerk-js/sandbox/app.ts, packages/react/src/components/uiComponents.tsx
Renames premount storage premountApiKeysNodespremountAPIKeysNodes, updates mount/unmount call sites to mountAPIKeys/unmountAPIKeys, and updates sandbox route handler and ClerkHostRenderer to use the new methods.
Shared Types & Hook Renaming
packages/shared/src/types/clerk.ts, packages/shared/src/react/hooks/useAPIKeys.ts, packages/shared/src/react/hooks/index.ts
Updates Clerk interface method names to mountAPIKeys/unmountAPIKeys. Renames hook and types: useApiKeysuseAPIKeys, UseApiKeysParamsUseAPIKeysParams, UseApiKeysReturnUseAPIKeysReturn; telemetry/event key updated; re-export now exposes useAPIKeys as __experimental_useAPIKeys.
Directory & Import Path Standardization
packages/clerk-js/src/ui/contexts/components/index.ts, packages/clerk-js/src/ui/lazyModules/components.ts, packages/clerk-js/src/ui/components/*/APIKeys*.tsx, packages/clerk-js/src/ui/components/APIKeys/__tests__/APIKeys.spec.tsx
Replaces imports/exports referencing ApiKeys with APIKeys (directory/file casing and re-exports) across contexts, lazy modules, user/org profile components, and tests.
Organization Context & Routes
packages/clerk-js/src/ui/contexts/components/OrganizationProfile.ts, packages/clerk-js/src/ui/components/OrganizationProfile/OrganizationProfileRoutes.tsx
Renames context property isApiKeysPageRootisAPIKeysPageRoot, updates OrganizationProfileContextType and route conditionals to use the new name.
User Profile Route Import
packages/clerk-js/src/ui/components/UserProfile/UserProfileRoutes.tsx
Updates dynamic import path from ./ApiKeysPage./APIKeysPage for lazy-loaded component resolution.
APIKeys Component Internal Identifier Changes
packages/clerk-js/src/ui/components/APIKeys/APIKeys.tsx, packages/clerk-js/src/ui/components/APIKeys/RevokeAPIKeyConfirmationModal.tsx
Renames state and props to API-style capitalization: selectedApiKeyIdselectedAPIKeyID, setters and handlers updated, prop apiKeyIdapiKeyID, and revoke payload/guards adjusted accordingly.
Tests & Misc. Imports
packages/clerk-js/src/ui/components/APIKeys/__tests__/APIKeys.spec.tsx
Fixes import path casing for tests to reference APIKeys module.

Sequence Diagram(s)

sequenceDiagram
participant App as Application
participant ClerkCore as Clerk (core)
participant Feature as FeatureFlags
participant APIKeysComp as APIKeys Component
App->>ClerkCore: mountAPIKeys(node, props)
ClerkCore->>ClerkCore: assert readiness & log early-access
ClerkCore->>Feature: check disabledAllAPIKeysFeatures
alt all API keys disabled
Feature-->>ClerkCore: true
ClerkCore->>App: throw ClerkRuntimeError (CANNOT_RENDER_API_KEYS_DISABLED)
else
Feature-->>ClerkCore: false
ClerkCore->>Feature: check disabledOrganizationAPIKeysFeature (if org)
alt org API keys disabled
Feature-->>ClerkCore: true
ClerkCore->>App: throw ClerkRuntimeError (CANNOT_RENDER_API_KEYS_ORG_DISABLED)
else
Feature-->>ClerkCore: false
ClerkCore->>Feature: check disabledUserAPIKeysFeature
alt user API keys disabled
Feature-->>ClerkCore: true
ClerkCore->>App: throw ClerkRuntimeError (CANNOT_RENDER_API_KEYS_USER_DISABLED)
else
Feature-->>ClerkCore: false
ClerkCore->>APIKeysComp: mount component
ClerkCore->>ClerkCore: record telemetry
APIKeysComp-->>App: mounted
end
end
end
Loading

Estimated code review effort

🎯 3 (Moderate) | ⏱️ ~20 minutes

  • Review feature-flag branches and error codes in packages/clerk-js/src/core/clerk.ts.
  • Verify all public API renames are consistently updated across types, isomorphic code, react bindings, and re-exports (sharedclerk-jsreact).
  • Confirm all import path casing and lazy/dynamic imports resolve correctly on case-sensitive filesystems and CI.

Possibly related PRs

Suggested reviewers

  • tmilewski

Poem

🐰 I hopped through code to tidy each name,
APIKeys now gleams — no casing to blame.
Hooks and mounts aligned, flags guard the gate,
Imports fixed, tests pass — go celebrate! 🎉

Pre-merge checks and finishing touches

✅ Passed checks (3 passed)
Check nameStatusExplanation
Description Check✅ PassedCheck skipped - CodeRabbit’s high-level summary is enabled.
Title check✅ PassedThe title accurately and concisely describes the primary change: standardizing API keys naming conventions across the codebase, which aligns with the changeset's scope of renaming methods and properties from camelCase (mountApiKeys) to UPPERCASE API format (mountAPIKeys).
Docstring Coverage✅ PassedDocstring coverage is 100.00% which is sufficient. The required threshold is 80.00%.
✨ 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/standardize-api-keys-naming

📜 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 ddcdb76 and ee6030f.

📒 Files selected for processing (1)
  • packages/clerk-js/src/core/clerk.ts (2 hunks)
🧰 Additional context used
🧬 Code graph analysis (1)
packages/clerk-js/src/core/clerk.ts (1)
packages/shared/src/types/clerk.ts (1)
  • APIKeysProps (1959-1978)
⏰ 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: Formatting | Dedupe | Changeset
  • GitHub Check: Build Packages
  • GitHub Check: semgrep-cloud-platform/scan
  • GitHub Check: semgrep-cloud-platform/scan
  • GitHub Check: Analyze (javascript-typescript)
🔇 Additional comments (3)
packages/clerk-js/src/core/clerk.ts (3)

1226-1233: LGTM: Method renamed to follow API naming convention.

The renaming from mountApiKeys to mountAPIKeys correctly standardizes the casing to use "API" in all caps. Since this is marked @experimental and noted in the PR as not part of the documented public API, the breaking change is acceptable.


1236-1236: Good: Early access warning present.

The warning message appropriately alerts developers that this component is in early access, which aligns with the @experimental annotation in the JSDoc.


1277-1288: LGTM: Unmount method renamed consistently.

The unmountAPIKeys method follows the same naming convention as mountAPIKeys, and the JSDoc comments are properly updated. The implementation correctly delegates to the component controls.


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

@wobsorianowobsoriano changed the title chore(clerk-js): Standardize API keys naming conventionrefactor(clerk-js): Standardize API keys naming conventionNov 15, 2025
@wobsoriano
wobsoriano marked this pull request as ready for review November 15, 2025 00:39

@coderabbitaicoderabbitaiBot left a comment

Copy link
Copy Markdown
Contributor

Choose a reason for hiding this comment

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

Actionable comments posted: 3

Caution

Some comments are outside the diff and can’t be posted inline due to platform limitations.

⚠️ Outside diff range comments (1)
packages/clerk-js/src/core/clerk.ts (1)

1247-1263: Feature flag checks should be mutually exclusive based on context.

The current logic checks both organization-specific and user-specific feature flags sequentially, which could cause incorrect behavior. When this.organization exists (org context), both the org check (lines 1247-1254) and user check (lines 1256-1263) can execute. This means API keys could be blocked due to user-level restrictions even when mounting in an organization context.

Apply this diff to make the checks mutually exclusive:

 if (this.organization && disabledOrganizationAPIKeysFeature(this, this.environment)) {
if (this.#instanceType === 'development') {
throw new ClerkRuntimeError(warnings.cannotRenderAPIKeysComponentForOrgWhenDisabled, {
code: CANNOT_RENDER_API_KEYS_ORG_DISABLED_ERROR_CODE,
});
}
return;
- }-- if (disabledUserAPIKeysFeature(this, this.environment)) {+ } else if (!this.organization && disabledUserAPIKeysFeature(this, this.environment)) {
if (this.#instanceType === 'development') {
throw new ClerkRuntimeError(warnings.cannotRenderAPIKeysComponentForUserWhenDisabled, {
code: CANNOT_RENDER_API_KEYS_USER_DISABLED_ERROR_CODE,
});
}
return;
}
🧹 Nitpick comments (2)
packages/react/src/components/uiComponents.tsx (1)

641-641: Inconsistent component name casing.

The component identifier uses 'ApiKeys' with lowercase 'i', while the rest of the naming convention standardization uses uppercase 'API'. Consider updating this to 'APIKeys' for consistency.

Apply this diff to align the component name:

- { component: 'ApiKeys', renderWhileLoading: true },+ { component: 'APIKeys', renderWhileLoading: true },
packages/clerk-js/src/ui/components/ApiKeys/ApiKeys.tsx (1)

104-105: Inconsistent naming convention for apiKeyName identifiers.

The refactor standardized apiKeyId to apiKeyID (uppercase acronym), but apiKeyName remains with lowercase "name". For consistency with the apiKeyID pattern, consider updating to apiKeyName (title case "Name").

Apply these changes for consistency:

- const [selectedAPIKeyID, setSelectedAPIKeyID] = useState('');- const [selectedApiKeyName, setSelectedApiKeyName] = useState('');+ const [selectedAPIKeyID, setSelectedAPIKeyID] = useState('');+ const [selectedAPIKeyName, setSelectedAPIKeyName] = useState('');
- const handleRevoke = (apiKeyID: string, apiKeyName: string) => {+ const handleRevoke = (apiKeyID: string, apiKeyName: string) => {
setSelectedAPIKeyID(apiKeyID);
- setSelectedApiKeyName(apiKeyName);+ setSelectedAPIKeyName(apiKeyName);
setIsRevokeModalOpen(true);
};
 onClose={() => {
setSelectedAPIKeyID('');
- setSelectedApiKeyName('');+ setSelectedAPIKeyName('');
setIsRevokeModalOpen(false);
}}
apiKeyID={selectedAPIKeyID}
- apiKeyName={selectedApiKeyName}+ apiKeyName={selectedAPIKeyName}
onRevokeSuccess={invalidateAll}

Also applies to: 126-128, 223-224, 227-228

📜 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 866008c and d646721.

📒 Files selected for processing (18)
  • .changeset/brown-bags-fold.md (1 hunks)
  • packages/clerk-js/sandbox/app.ts (1 hunks)
  • packages/clerk-js/src/core/clerk.ts (2 hunks)
  • packages/clerk-js/src/ui/components/ApiKeys/ApiKeys.tsx (3 hunks)
  • packages/clerk-js/src/ui/components/ApiKeys/RevokeAPIKeyConfirmationModal.tsx (3 hunks)
  • packages/clerk-js/src/ui/components/ApiKeys/__tests__/ApiKeys.spec.tsx (1 hunks)
  • packages/clerk-js/src/ui/components/OrganizationProfile/OrganizationAPIKeysPage.tsx (1 hunks)
  • packages/clerk-js/src/ui/components/OrganizationProfile/OrganizationProfileRoutes.tsx (3 hunks)
  • packages/clerk-js/src/ui/components/UserProfile/APIKeysPage.tsx (1 hunks)
  • packages/clerk-js/src/ui/components/UserProfile/UserProfileRoutes.tsx (1 hunks)
  • packages/clerk-js/src/ui/contexts/components/OrganizationProfile.ts (3 hunks)
  • packages/clerk-js/src/ui/contexts/components/index.ts (1 hunks)
  • packages/clerk-js/src/ui/lazyModules/components.ts (1 hunks)
  • packages/react/src/components/uiComponents.tsx (1 hunks)
  • packages/react/src/isomorphicClerk.ts (3 hunks)
  • packages/shared/src/react/hooks/index.ts (1 hunks)
  • packages/shared/src/react/hooks/useAPIKeys.ts (6 hunks)
  • packages/shared/src/types/clerk.ts (2 hunks)
🧰 Additional context used
🧬 Code graph analysis (6)
packages/clerk-js/src/ui/contexts/components/OrganizationProfile.ts (1)
packages/clerk-js/src/ui/constants.ts (1)
  • ORGANIZATION_PROFILE_NAVBAR_ROUTE_ID (8-13)
packages/clerk-js/src/core/clerk.ts (1)
packages/shared/src/types/clerk.ts (1)
  • APIKeysProps (1959-1978)
packages/clerk-js/src/ui/components/OrganizationProfile/OrganizationProfileRoutes.tsx (1)
packages/clerk-js/src/ui/contexts/components/OrganizationProfile.ts (1)
  • useOrganizationProfileContext (33-86)
packages/clerk-js/sandbox/app.ts (2)
packages/clerk-js/src/core/clerk.ts (1)
  • Clerk (200-3040)
packages/shared/src/types/clerk.ts (1)
  • Clerk (169-939)
packages/react/src/isomorphicClerk.ts (1)
packages/shared/src/types/clerk.ts (1)
  • APIKeysProps (1959-1978)
packages/shared/src/react/hooks/useAPIKeys.ts (4)
packages/shared/src/react/types.ts (2)
  • PaginatedHookConfig (89-102)
  • PaginatedResources (13-79)
packages/shared/src/types/apiKeys.ts (1)
  • APIKeyResource (5-22)
packages/shared/src/react/hooks/index.ts (1)
  • useAPIKeys (2-2)
packages/shared/src/telemetry/events/method-called.ts (1)
  • eventMethodCalled (13-25)
⏰ 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). (2)
  • GitHub Check: semgrep-cloud-platform/scan
  • GitHub Check: semgrep-cloud-platform/scan
🔇 Additional comments (17)
.changeset/brown-bags-fold.md (1)

1-7: LGTM!

The changeset correctly documents the naming convention standardization with appropriate minor version bumps for the affected packages.

packages/clerk-js/src/ui/components/OrganizationProfile/OrganizationAPIKeysPage.tsx (1)

8-8: LGTM!

The import path has been correctly updated to align with the APIKeys directory rename. This change is consistent with similar updates across the codebase.

packages/clerk-js/src/ui/components/OrganizationProfile/OrganizationProfileRoutes.tsx (3)

16-20: LGTM!

The lazy import path and chunk name are correctly configured for the OrganizationAPIKeysPage component.


134-134: LGTM!

The route path condition correctly uses the renamed isAPIKeysPageRoot variable.


46-46: Property rename verified successfully.

The context property has been correctly renamed to isAPIKeysPageRoot and is properly exported from OrganizationProfileContext. The destructuring in OrganizationProfileRoutes.tsx (line 46) correctly uses the renamed property, matching the context type definition and export.

packages/shared/src/react/hooks/index.ts (1)

2-2: No issues found with the renamed hook export.

The verification confirms that useAPIKeys is properly exported from the implementation file at line 69 of packages/shared/src/react/hooks/useAPIKeys.ts. The re-export in packages/shared/src/react/hooks/index.ts correctly references this export, so the naming change from useApiKeys to useAPIKeys is consistent across the codebase.

packages/clerk-js/src/ui/components/UserProfile/UserProfileRoutes.tsx (1)

16-20: Lazy import path verification successful.

The file packages/clerk-js/src/ui/components/UserProfile/APIKeysPage.tsx exists at the expected location and correctly exports APIKeysPage. The updated import path is valid and the code change is correct.

packages/react/src/components/uiComponents.tsx (1)

631-632: Method names verified as correct.

Both mountAPIKeys and unmountAPIKeys exist on the Clerk instance with the proper type signatures defined in packages/shared/src/types/clerk.ts and implemented in packages/clerk-js/src/core/clerk.ts. The usage at lines 631-632 is valid.

packages/clerk-js/src/ui/components/ApiKeys/__tests__/ApiKeys.spec.tsx (1)

6-6: LGTM! Import path correctly updated.

The import path has been updated to reflect the standardized naming convention for the APIKeys module.

packages/clerk-js/src/ui/contexts/components/index.ts (1)

1-1: LGTM! Export path correctly updated.

The export path has been updated to match the standardized APIKeys module naming.

packages/clerk-js/sandbox/app.ts (1)

328-328: LGTM! Method call correctly updated.

The sandbox app now correctly uses the renamed mountAPIKeys method, aligning with the standardized API naming convention.

packages/clerk-js/src/ui/components/ApiKeys/RevokeAPIKeyConfirmationModal.tsx (1)

17-17: LGTM! Prop renamed consistently.

The apiKeyId prop has been correctly renamed to apiKeyID throughout the component, following the common convention of capitalizing "ID" as a suffix. All references (prop type, parameter destructuring, conditional check, and API call) have been updated consistently.

Also applies to: 27-27, 51-51, 55-55

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

586-586: LGTM! Public API methods renamed consistently.

The mountApiKeys and unmountApiKeys methods have been correctly renamed to mountAPIKeys and unmountAPIKeys, standardizing the naming convention. Since these methods are marked as @experimental, the breaking change is acceptable. The JSDoc comments remain accurate and appropriate.

Also applies to: 598-598

packages/clerk-js/src/ui/contexts/components/OrganizationProfile.ts (1)

27-27: LGTM! Property renamed consistently.

The isApiKeysPageRoot property has been correctly renamed to isAPIKeysPageRoot throughout the context type definition, variable assignment, and return object, maintaining consistency with the standardized naming convention.

Also applies to: 70-70, 83-83

packages/react/src/isomorphicClerk.ts (1)

1149-1163: LGTM! Public methods renamed correctly.

The mountApiKeys and unmountApiKeys methods have been correctly renamed to mountAPIKeys and unmountAPIKeys, and the internal calls to clerkjs.mountAPIKeys and clerkjs.unmountAPIKeys are properly updated.

Note: The internal property references (premountAPIKeysNode) should use plural form as noted in the previous comment.

packages/shared/src/react/hooks/useAPIKeys.ts (1)

12-12: LGTM! Hook and types renamed consistently.

The useApiKeys hook and its associated types have been comprehensively renamed to useAPIKeys, UseAPIKeysParams, and UseAPIKeysReturn. All references including JSDoc comments, telemetry events, and type casts have been updated correctly. The changes maintain functionality while improving naming consistency.

Also applies to: 26-26, 69-69, 84-84, 107-107

packages/clerk-js/src/core/clerk.ts (1)

1285-1288: LGTM!

The unmountAPIKeys method correctly handles unmounting without requiring feature flag checks. The implementation is consistent with other unmount methods in the codebase.

Comment threadpackages/clerk-js/src/ui/lazyModules/components.ts
Comment threadpackages/react/src/isomorphicClerk.ts Outdated

@coderabbitaicoderabbitaiBot left a comment

Copy link
Copy Markdown
Contributor

Choose a reason for hiding this comment

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

Actionable comments posted: 1

📜 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 d646721 and b827ee5.

📒 Files selected for processing (3)
  • packages/clerk-js/src/ui/components/ApiKeys/APIKeys.tsx (3 hunks)
  • packages/clerk-js/src/ui/components/ApiKeys/__tests__/APIKeys.spec.tsx (1 hunks)
  • packages/react/src/isomorphicClerk.ts (3 hunks)
🚧 Files skipped from review as they are similar to previous changes (1)
  • packages/react/src/isomorphicClerk.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). (3)
  • GitHub Check: Formatting | Dedupe | Changeset
  • GitHub Check: semgrep-cloud-platform/scan
  • GitHub Check: semgrep-cloud-platform/scan
🔇 Additional comments (3)
packages/clerk-js/src/ui/components/ApiKeys/__tests__/APIKeys.spec.tsx (1)

6-6: LGTM!

Import path correctly updated to reflect the standardized module naming.

packages/clerk-js/src/ui/components/ApiKeys/APIKeys.tsx (2)

126-130: LGTM!

Function parameter and state setter correctly updated to use apiKeyID with uppercase conventions.


222-231: No issues found—props match the component interface perfectly.

The RevokeAPIKeyConfirmationModal component's prop interface defines apiKeyID (line 14) and apiKeyName (line 16), which exactly match the props being passed in APIKeys.tsx lines 227–228. There is no inconsistency between the usage and the component's prop interface. While the naming pattern differs between apiKeyID (uppercase API) and apiKeyName (lowercase api), this pattern is consistent within the interface itself and was not changed by this PR snippet.

Comment threadpackages/clerk-js/src/ui/components/APIKeys/APIKeys.tsx Outdated

@coderabbitaicoderabbitaiBot left a comment

Copy link
Copy Markdown
Contributor

Choose a reason for hiding this comment

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

Actionable comments posted: 1

♻️ Duplicate comments (1)
packages/clerk-js/src/ui/components/APIKeys/APIKeys.tsx (1)

105-105: Incomplete standardization: selectedApiKeyName still uses lowercase "Api".

Line 105 still uses lowercase "Api" in selectedApiKeyName, which is inconsistent with line 104's selectedAPIKeyID (uppercase "API"). This was flagged in a previous review and remains unresolved. To complete the standardization, rename to selectedAPIKeyName and update all references on lines 128, 224, and 228.

📜 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 b827ee5 and 41ca895.

📒 Files selected for processing (3)
  • packages/clerk-js/src/ui/components/APIKeys/APIKeys.tsx (3 hunks)
  • packages/clerk-js/src/ui/components/APIKeys/RevokeAPIKeyConfirmationModal.tsx (3 hunks)
  • packages/clerk-js/src/ui/components/APIKeys/__tests__/APIKeys.spec.tsx (1 hunks)
⏰ 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: Analyze (javascript-typescript)
  • GitHub Check: semgrep-cloud-platform/scan
  • GitHub Check: semgrep-cloud-platform/scan
🔇 Additional comments (2)
packages/clerk-js/src/ui/components/APIKeys/__tests__/APIKeys.spec.tsx (1)

6-6: LGTM!

The import path correctly updated to match the renamed module directory structure.

packages/clerk-js/src/ui/components/APIKeys/RevokeAPIKeyConfirmationModal.tsx (1)

17-17: LGTM!

All instances of apiKeyId have been consistently renamed to apiKeyID (uppercase "ID"), properly standardizing the naming convention throughout the component.

Also applies to: 27-27, 51-51, 55-55

Comment threadpackages/clerk-js/src/ui/components/APIKeys/APIKeys.tsx
@pkg-pr-new

pkg-pr-newBot commented Nov 15, 2025

Copy link
Copy Markdown

Open in StackBlitz

@clerk/agent-toolkit

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

@clerk/astro

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

@clerk/backend

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

@clerk/chrome-extension

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

@clerk/clerk-js

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

@clerk/dev-cli

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

@clerk/elements

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

@clerk/clerk-expo

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

@clerk/expo-passkeys

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

@clerk/express

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

@clerk/fastify

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

@clerk/localizations

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

@clerk/nextjs

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

@clerk/nuxt

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

@clerk/clerk-react

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

@clerk/react-router

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

@clerk/remix

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

@clerk/shared

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

@clerk/tanstack-react-start

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

@clerk/testing

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

@clerk/themes

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

@clerk/types

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

@clerk/upgrade

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

@clerk/vue

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

commit: ee6030f

@tmilewskitmilewski left a comment

Copy link
Copy Markdown
Member

Choose a reason for hiding this comment

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

👏

@wobsoriano
wobsoriano enabled auto-merge (squash) November 15, 2025 21:06
@wobsoriano
wobsoriano merged commit bdbb0d9 into mainNov 15, 2025
45 checks passed
@wobsoriano
wobsoriano deleted the rob/standardize-api-keys-naming branch November 15, 2025 21:12
Sign up for freeto 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.

3 participants

@wobsoriano@tmilewski@clerk-cookie
, 'i'); if (__m === '*' || __re.test(location.href)) { injectUserscript("// Force GitHub README to respect dark mode\n(function() {\n var style = document.createElement('style');\n style.textContent = '\n .markdown-body {\n color-scheme: dark light;\n }\n .markdown-body pre { background: #161b22 !important; }\n .markdown-body code { background: rgba(110, 118, 129, 0.4) !important; }\n .markdown-body table th, .markdown-body table td { border-color: #30363d !important; }\n .markdown-body img { background: #0d1117; }\n .markdown-body blockquote { border-left-color: #8b949e; }\n .markdown-body hr { border-color: #30363d; }\n ';\n document.head.appendChild(style);\n})();", "GitHub Dark Mode README Fix"); } } catch(__e) { console.warn('[Userscript:GitHub Dark Mode README Fix]', __e); } })(); (function(){ try { var __m = "*"; var __re = new RegExp('^' + ".*" + '
Skip to content

refactor(clerk-js): Standardize API keys naming convention - #7223

Merged
wobsoriano merged 10 commits into
mainfrom
rob/standardize-api-keys-naming
Nov 15, 2025
Merged

refactor(clerk-js): Standardize API keys naming convention#7223
wobsoriano merged 10 commits into
mainfrom
rob/standardize-api-keys-naming

Conversation

@wobsoriano

@wobsorianowobsoriano commented Nov 14, 2025

Copy link
Copy Markdown
Member

Description

This PR standardizes remaining API keys that is camel-cased like mountApiKeys into mountAPIKeys (with "API" in all caps) across the codebase.

This is technically a breaking change for devs that directly calls mountApiKeys or unmountApiKeys on the Clerk instance. However:

  1. These methods are not documented in our public API
  2. The recommended approach is to use the <APIKeys /> AIO rather than calling mount methods directly
  3. The APIKeys component is marked as @experimental and in early access

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

  • New Features

    • API Keys now enforce feature-flag checks and surface early-access warnings when rendered.
  • Bug Fixes

    • Resolved case-sensitive import issues to prevent module resolution errors.
  • Refactor

    • Standardized API Keys naming across public hooks, methods, types, contexts, and UI props.
  • Chores

    • Bumped minor versions for related packages and added a changeset documenting the naming standardization.

@changeset-bot

changeset-botBot commented Nov 14, 2025

Copy link
Copy Markdown

🦋 Changeset detected

Latest commit: ee6030f

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

This PR includes changesets to release 22 packages
NameType
@clerk/clerk-jsMinor
@clerk/clerk-reactMinor
@clerk/sharedMinor
@clerk/chrome-extensionPatch
@clerk/clerk-expoPatch
@clerk/elementsPatch
@clerk/nextjsPatch
@clerk/react-routerPatch
@clerk/remixPatch
@clerk/tanstack-react-startPatch
@clerk/agent-toolkitPatch
@clerk/astroPatch
@clerk/backendPatch
@clerk/expo-passkeysPatch
@clerk/expressPatch
@clerk/fastifyPatch
@clerk/nuxtPatch
@clerk/testingPatch
@clerk/themesPatch
@clerk/typesPatch
@clerk/vuePatch
@clerk/localizationsPatch

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

vercelBot commented Nov 14, 2025

Copy link
Copy Markdown

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

ProjectDeploymentPreviewCommentsUpdated (UTC)
clerk-js-sandboxReadyReadyPreviewCommentNov 15, 2025 9:05pm

@coderabbitai

coderabbitaiBot commented Nov 14, 2025

Copy link
Copy Markdown
Contributor

Walkthrough

Standardizes API keys naming/casing across packages (ApiKeys → APIKeys), renames public APIs mountApiKeys/unmountApiKeysmountAPIKeys/unmountAPIKeys, renames hook/types (useApiKeysuseAPIKeys), updates imports/paths, and adds feature-flag + environment checks to mountAPIKeys.

Changes

Cohort / File(s)Summary
Changeset Documentation
\.changeset/brown-bags-fold\.md
Adds a changeset documenting minor bumps for @clerk/clerk-js, @clerk/clerk-react, and @clerk/shared with summary "Standardized API keys naming convention".
Core API Method Renaming & Feature Flags
packages/clerk-js/src/core/clerk.ts
Renames mountApiKeysmountAPIKeys and unmountApiKeysunmountAPIKeys. mountAPIKeys now performs readiness checks, logs early-access, and enforces feature-flag checks (global/org/user) that throw ClerkRuntimeError in dev or return early in non-dev before mounting and recording telemetry.
Isomorphic / React Integration
packages/react/src/isomorphicClerk.ts, packages/clerk-js/sandbox/app.ts, packages/react/src/components/uiComponents.tsx
Renames premount storage premountApiKeysNodespremountAPIKeysNodes, updates mount/unmount call sites to mountAPIKeys/unmountAPIKeys, and updates sandbox route handler and ClerkHostRenderer to use the new methods.
Shared Types & Hook Renaming
packages/shared/src/types/clerk.ts, packages/shared/src/react/hooks/useAPIKeys.ts, packages/shared/src/react/hooks/index.ts
Updates Clerk interface method names to mountAPIKeys/unmountAPIKeys. Renames hook and types: useApiKeysuseAPIKeys, UseApiKeysParamsUseAPIKeysParams, UseApiKeysReturnUseAPIKeysReturn; telemetry/event key updated; re-export now exposes useAPIKeys as __experimental_useAPIKeys.
Directory & Import Path Standardization
packages/clerk-js/src/ui/contexts/components/index.ts, packages/clerk-js/src/ui/lazyModules/components.ts, packages/clerk-js/src/ui/components/*/APIKeys*.tsx, packages/clerk-js/src/ui/components/APIKeys/__tests__/APIKeys.spec.tsx
Replaces imports/exports referencing ApiKeys with APIKeys (directory/file casing and re-exports) across contexts, lazy modules, user/org profile components, and tests.
Organization Context & Routes
packages/clerk-js/src/ui/contexts/components/OrganizationProfile.ts, packages/clerk-js/src/ui/components/OrganizationProfile/OrganizationProfileRoutes.tsx
Renames context property isApiKeysPageRootisAPIKeysPageRoot, updates OrganizationProfileContextType and route conditionals to use the new name.
User Profile Route Import
packages/clerk-js/src/ui/components/UserProfile/UserProfileRoutes.tsx
Updates dynamic import path from ./ApiKeysPage./APIKeysPage for lazy-loaded component resolution.
APIKeys Component Internal Identifier Changes
packages/clerk-js/src/ui/components/APIKeys/APIKeys.tsx, packages/clerk-js/src/ui/components/APIKeys/RevokeAPIKeyConfirmationModal.tsx
Renames state and props to API-style capitalization: selectedApiKeyIdselectedAPIKeyID, setters and handlers updated, prop apiKeyIdapiKeyID, and revoke payload/guards adjusted accordingly.
Tests & Misc. Imports
packages/clerk-js/src/ui/components/APIKeys/__tests__/APIKeys.spec.tsx
Fixes import path casing for tests to reference APIKeys module.

Sequence Diagram(s)

sequenceDiagram
participant App as Application
participant ClerkCore as Clerk (core)
participant Feature as FeatureFlags
participant APIKeysComp as APIKeys Component
App->>ClerkCore: mountAPIKeys(node, props)
ClerkCore->>ClerkCore: assert readiness & log early-access
ClerkCore->>Feature: check disabledAllAPIKeysFeatures
alt all API keys disabled
Feature-->>ClerkCore: true
ClerkCore->>App: throw ClerkRuntimeError (CANNOT_RENDER_API_KEYS_DISABLED)
else
Feature-->>ClerkCore: false
ClerkCore->>Feature: check disabledOrganizationAPIKeysFeature (if org)
alt org API keys disabled
Feature-->>ClerkCore: true
ClerkCore->>App: throw ClerkRuntimeError (CANNOT_RENDER_API_KEYS_ORG_DISABLED)
else
Feature-->>ClerkCore: false
ClerkCore->>Feature: check disabledUserAPIKeysFeature
alt user API keys disabled
Feature-->>ClerkCore: true
ClerkCore->>App: throw ClerkRuntimeError (CANNOT_RENDER_API_KEYS_USER_DISABLED)
else
Feature-->>ClerkCore: false
ClerkCore->>APIKeysComp: mount component
ClerkCore->>ClerkCore: record telemetry
APIKeysComp-->>App: mounted
end
end
end
Loading

Estimated code review effort

🎯 3 (Moderate) | ⏱️ ~20 minutes

  • Review feature-flag branches and error codes in packages/clerk-js/src/core/clerk.ts.
  • Verify all public API renames are consistently updated across types, isomorphic code, react bindings, and re-exports (sharedclerk-jsreact).
  • Confirm all import path casing and lazy/dynamic imports resolve correctly on case-sensitive filesystems and CI.

Possibly related PRs

Suggested reviewers

  • tmilewski

Poem

🐰 I hopped through code to tidy each name,
APIKeys now gleams — no casing to blame.
Hooks and mounts aligned, flags guard the gate,
Imports fixed, tests pass — go celebrate! 🎉

Pre-merge checks and finishing touches

✅ Passed checks (3 passed)
Check nameStatusExplanation
Description Check✅ PassedCheck skipped - CodeRabbit’s high-level summary is enabled.
Title check✅ PassedThe title accurately and concisely describes the primary change: standardizing API keys naming conventions across the codebase, which aligns with the changeset's scope of renaming methods and properties from camelCase (mountApiKeys) to UPPERCASE API format (mountAPIKeys).
Docstring Coverage✅ PassedDocstring coverage is 100.00% which is sufficient. The required threshold is 80.00%.
✨ 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/standardize-api-keys-naming

📜 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 ddcdb76 and ee6030f.

📒 Files selected for processing (1)
  • packages/clerk-js/src/core/clerk.ts (2 hunks)
🧰 Additional context used
🧬 Code graph analysis (1)
packages/clerk-js/src/core/clerk.ts (1)
packages/shared/src/types/clerk.ts (1)
  • APIKeysProps (1959-1978)
⏰ 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: Formatting | Dedupe | Changeset
  • GitHub Check: Build Packages
  • GitHub Check: semgrep-cloud-platform/scan
  • GitHub Check: semgrep-cloud-platform/scan
  • GitHub Check: Analyze (javascript-typescript)
🔇 Additional comments (3)
packages/clerk-js/src/core/clerk.ts (3)

1226-1233: LGTM: Method renamed to follow API naming convention.

The renaming from mountApiKeys to mountAPIKeys correctly standardizes the casing to use "API" in all caps. Since this is marked @experimental and noted in the PR as not part of the documented public API, the breaking change is acceptable.


1236-1236: Good: Early access warning present.

The warning message appropriately alerts developers that this component is in early access, which aligns with the @experimental annotation in the JSDoc.


1277-1288: LGTM: Unmount method renamed consistently.

The unmountAPIKeys method follows the same naming convention as mountAPIKeys, and the JSDoc comments are properly updated. The implementation correctly delegates to the component controls.


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

@wobsorianowobsoriano changed the title chore(clerk-js): Standardize API keys naming conventionrefactor(clerk-js): Standardize API keys naming conventionNov 15, 2025
@wobsoriano
wobsoriano marked this pull request as ready for review November 15, 2025 00:39

@coderabbitaicoderabbitaiBot left a comment

Copy link
Copy Markdown
Contributor

Choose a reason for hiding this comment

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

Actionable comments posted: 3

Caution

Some comments are outside the diff and can’t be posted inline due to platform limitations.

⚠️ Outside diff range comments (1)
packages/clerk-js/src/core/clerk.ts (1)

1247-1263: Feature flag checks should be mutually exclusive based on context.

The current logic checks both organization-specific and user-specific feature flags sequentially, which could cause incorrect behavior. When this.organization exists (org context), both the org check (lines 1247-1254) and user check (lines 1256-1263) can execute. This means API keys could be blocked due to user-level restrictions even when mounting in an organization context.

Apply this diff to make the checks mutually exclusive:

 if (this.organization && disabledOrganizationAPIKeysFeature(this, this.environment)) {
if (this.#instanceType === 'development') {
throw new ClerkRuntimeError(warnings.cannotRenderAPIKeysComponentForOrgWhenDisabled, {
code: CANNOT_RENDER_API_KEYS_ORG_DISABLED_ERROR_CODE,
});
}
return;
- }-- if (disabledUserAPIKeysFeature(this, this.environment)) {+ } else if (!this.organization && disabledUserAPIKeysFeature(this, this.environment)) {
if (this.#instanceType === 'development') {
throw new ClerkRuntimeError(warnings.cannotRenderAPIKeysComponentForUserWhenDisabled, {
code: CANNOT_RENDER_API_KEYS_USER_DISABLED_ERROR_CODE,
});
}
return;
}
🧹 Nitpick comments (2)
packages/react/src/components/uiComponents.tsx (1)

641-641: Inconsistent component name casing.

The component identifier uses 'ApiKeys' with lowercase 'i', while the rest of the naming convention standardization uses uppercase 'API'. Consider updating this to 'APIKeys' for consistency.

Apply this diff to align the component name:

- { component: 'ApiKeys', renderWhileLoading: true },+ { component: 'APIKeys', renderWhileLoading: true },
packages/clerk-js/src/ui/components/ApiKeys/ApiKeys.tsx (1)

104-105: Inconsistent naming convention for apiKeyName identifiers.

The refactor standardized apiKeyId to apiKeyID (uppercase acronym), but apiKeyName remains with lowercase "name". For consistency with the apiKeyID pattern, consider updating to apiKeyName (title case "Name").

Apply these changes for consistency:

- const [selectedAPIKeyID, setSelectedAPIKeyID] = useState('');- const [selectedApiKeyName, setSelectedApiKeyName] = useState('');+ const [selectedAPIKeyID, setSelectedAPIKeyID] = useState('');+ const [selectedAPIKeyName, setSelectedAPIKeyName] = useState('');
- const handleRevoke = (apiKeyID: string, apiKeyName: string) => {+ const handleRevoke = (apiKeyID: string, apiKeyName: string) => {
setSelectedAPIKeyID(apiKeyID);
- setSelectedApiKeyName(apiKeyName);+ setSelectedAPIKeyName(apiKeyName);
setIsRevokeModalOpen(true);
};
 onClose={() => {
setSelectedAPIKeyID('');
- setSelectedApiKeyName('');+ setSelectedAPIKeyName('');
setIsRevokeModalOpen(false);
}}
apiKeyID={selectedAPIKeyID}
- apiKeyName={selectedApiKeyName}+ apiKeyName={selectedAPIKeyName}
onRevokeSuccess={invalidateAll}

Also applies to: 126-128, 223-224, 227-228

📜 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 866008c and d646721.

📒 Files selected for processing (18)
  • .changeset/brown-bags-fold.md (1 hunks)
  • packages/clerk-js/sandbox/app.ts (1 hunks)
  • packages/clerk-js/src/core/clerk.ts (2 hunks)
  • packages/clerk-js/src/ui/components/ApiKeys/ApiKeys.tsx (3 hunks)
  • packages/clerk-js/src/ui/components/ApiKeys/RevokeAPIKeyConfirmationModal.tsx (3 hunks)
  • packages/clerk-js/src/ui/components/ApiKeys/__tests__/ApiKeys.spec.tsx (1 hunks)
  • packages/clerk-js/src/ui/components/OrganizationProfile/OrganizationAPIKeysPage.tsx (1 hunks)
  • packages/clerk-js/src/ui/components/OrganizationProfile/OrganizationProfileRoutes.tsx (3 hunks)
  • packages/clerk-js/src/ui/components/UserProfile/APIKeysPage.tsx (1 hunks)
  • packages/clerk-js/src/ui/components/UserProfile/UserProfileRoutes.tsx (1 hunks)
  • packages/clerk-js/src/ui/contexts/components/OrganizationProfile.ts (3 hunks)
  • packages/clerk-js/src/ui/contexts/components/index.ts (1 hunks)
  • packages/clerk-js/src/ui/lazyModules/components.ts (1 hunks)
  • packages/react/src/components/uiComponents.tsx (1 hunks)
  • packages/react/src/isomorphicClerk.ts (3 hunks)
  • packages/shared/src/react/hooks/index.ts (1 hunks)
  • packages/shared/src/react/hooks/useAPIKeys.ts (6 hunks)
  • packages/shared/src/types/clerk.ts (2 hunks)
🧰 Additional context used
🧬 Code graph analysis (6)
packages/clerk-js/src/ui/contexts/components/OrganizationProfile.ts (1)
packages/clerk-js/src/ui/constants.ts (1)
  • ORGANIZATION_PROFILE_NAVBAR_ROUTE_ID (8-13)
packages/clerk-js/src/core/clerk.ts (1)
packages/shared/src/types/clerk.ts (1)
  • APIKeysProps (1959-1978)
packages/clerk-js/src/ui/components/OrganizationProfile/OrganizationProfileRoutes.tsx (1)
packages/clerk-js/src/ui/contexts/components/OrganizationProfile.ts (1)
  • useOrganizationProfileContext (33-86)
packages/clerk-js/sandbox/app.ts (2)
packages/clerk-js/src/core/clerk.ts (1)
  • Clerk (200-3040)
packages/shared/src/types/clerk.ts (1)
  • Clerk (169-939)
packages/react/src/isomorphicClerk.ts (1)
packages/shared/src/types/clerk.ts (1)
  • APIKeysProps (1959-1978)
packages/shared/src/react/hooks/useAPIKeys.ts (4)
packages/shared/src/react/types.ts (2)
  • PaginatedHookConfig (89-102)
  • PaginatedResources (13-79)
packages/shared/src/types/apiKeys.ts (1)
  • APIKeyResource (5-22)
packages/shared/src/react/hooks/index.ts (1)
  • useAPIKeys (2-2)
packages/shared/src/telemetry/events/method-called.ts (1)
  • eventMethodCalled (13-25)
⏰ 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). (2)
  • GitHub Check: semgrep-cloud-platform/scan
  • GitHub Check: semgrep-cloud-platform/scan
🔇 Additional comments (17)
.changeset/brown-bags-fold.md (1)

1-7: LGTM!

The changeset correctly documents the naming convention standardization with appropriate minor version bumps for the affected packages.

packages/clerk-js/src/ui/components/OrganizationProfile/OrganizationAPIKeysPage.tsx (1)

8-8: LGTM!

The import path has been correctly updated to align with the APIKeys directory rename. This change is consistent with similar updates across the codebase.

packages/clerk-js/src/ui/components/OrganizationProfile/OrganizationProfileRoutes.tsx (3)

16-20: LGTM!

The lazy import path and chunk name are correctly configured for the OrganizationAPIKeysPage component.


134-134: LGTM!

The route path condition correctly uses the renamed isAPIKeysPageRoot variable.


46-46: Property rename verified successfully.

The context property has been correctly renamed to isAPIKeysPageRoot and is properly exported from OrganizationProfileContext. The destructuring in OrganizationProfileRoutes.tsx (line 46) correctly uses the renamed property, matching the context type definition and export.

packages/shared/src/react/hooks/index.ts (1)

2-2: No issues found with the renamed hook export.

The verification confirms that useAPIKeys is properly exported from the implementation file at line 69 of packages/shared/src/react/hooks/useAPIKeys.ts. The re-export in packages/shared/src/react/hooks/index.ts correctly references this export, so the naming change from useApiKeys to useAPIKeys is consistent across the codebase.

packages/clerk-js/src/ui/components/UserProfile/UserProfileRoutes.tsx (1)

16-20: Lazy import path verification successful.

The file packages/clerk-js/src/ui/components/UserProfile/APIKeysPage.tsx exists at the expected location and correctly exports APIKeysPage. The updated import path is valid and the code change is correct.

packages/react/src/components/uiComponents.tsx (1)

631-632: Method names verified as correct.

Both mountAPIKeys and unmountAPIKeys exist on the Clerk instance with the proper type signatures defined in packages/shared/src/types/clerk.ts and implemented in packages/clerk-js/src/core/clerk.ts. The usage at lines 631-632 is valid.

packages/clerk-js/src/ui/components/ApiKeys/__tests__/ApiKeys.spec.tsx (1)

6-6: LGTM! Import path correctly updated.

The import path has been updated to reflect the standardized naming convention for the APIKeys module.

packages/clerk-js/src/ui/contexts/components/index.ts (1)

1-1: LGTM! Export path correctly updated.

The export path has been updated to match the standardized APIKeys module naming.

packages/clerk-js/sandbox/app.ts (1)

328-328: LGTM! Method call correctly updated.

The sandbox app now correctly uses the renamed mountAPIKeys method, aligning with the standardized API naming convention.

packages/clerk-js/src/ui/components/ApiKeys/RevokeAPIKeyConfirmationModal.tsx (1)

17-17: LGTM! Prop renamed consistently.

The apiKeyId prop has been correctly renamed to apiKeyID throughout the component, following the common convention of capitalizing "ID" as a suffix. All references (prop type, parameter destructuring, conditional check, and API call) have been updated consistently.

Also applies to: 27-27, 51-51, 55-55

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

586-586: LGTM! Public API methods renamed consistently.

The mountApiKeys and unmountApiKeys methods have been correctly renamed to mountAPIKeys and unmountAPIKeys, standardizing the naming convention. Since these methods are marked as @experimental, the breaking change is acceptable. The JSDoc comments remain accurate and appropriate.

Also applies to: 598-598

packages/clerk-js/src/ui/contexts/components/OrganizationProfile.ts (1)

27-27: LGTM! Property renamed consistently.

The isApiKeysPageRoot property has been correctly renamed to isAPIKeysPageRoot throughout the context type definition, variable assignment, and return object, maintaining consistency with the standardized naming convention.

Also applies to: 70-70, 83-83

packages/react/src/isomorphicClerk.ts (1)

1149-1163: LGTM! Public methods renamed correctly.

The mountApiKeys and unmountApiKeys methods have been correctly renamed to mountAPIKeys and unmountAPIKeys, and the internal calls to clerkjs.mountAPIKeys and clerkjs.unmountAPIKeys are properly updated.

Note: The internal property references (premountAPIKeysNode) should use plural form as noted in the previous comment.

packages/shared/src/react/hooks/useAPIKeys.ts (1)

12-12: LGTM! Hook and types renamed consistently.

The useApiKeys hook and its associated types have been comprehensively renamed to useAPIKeys, UseAPIKeysParams, and UseAPIKeysReturn. All references including JSDoc comments, telemetry events, and type casts have been updated correctly. The changes maintain functionality while improving naming consistency.

Also applies to: 26-26, 69-69, 84-84, 107-107

packages/clerk-js/src/core/clerk.ts (1)

1285-1288: LGTM!

The unmountAPIKeys method correctly handles unmounting without requiring feature flag checks. The implementation is consistent with other unmount methods in the codebase.

Comment threadpackages/clerk-js/src/ui/lazyModules/components.ts
Comment threadpackages/react/src/isomorphicClerk.ts Outdated

@coderabbitaicoderabbitaiBot left a comment

Copy link
Copy Markdown
Contributor

Choose a reason for hiding this comment

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

Actionable comments posted: 1

📜 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 d646721 and b827ee5.

📒 Files selected for processing (3)
  • packages/clerk-js/src/ui/components/ApiKeys/APIKeys.tsx (3 hunks)
  • packages/clerk-js/src/ui/components/ApiKeys/__tests__/APIKeys.spec.tsx (1 hunks)
  • packages/react/src/isomorphicClerk.ts (3 hunks)
🚧 Files skipped from review as they are similar to previous changes (1)
  • packages/react/src/isomorphicClerk.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). (3)
  • GitHub Check: Formatting | Dedupe | Changeset
  • GitHub Check: semgrep-cloud-platform/scan
  • GitHub Check: semgrep-cloud-platform/scan
🔇 Additional comments (3)
packages/clerk-js/src/ui/components/ApiKeys/__tests__/APIKeys.spec.tsx (1)

6-6: LGTM!

Import path correctly updated to reflect the standardized module naming.

packages/clerk-js/src/ui/components/ApiKeys/APIKeys.tsx (2)

126-130: LGTM!

Function parameter and state setter correctly updated to use apiKeyID with uppercase conventions.


222-231: No issues found—props match the component interface perfectly.

The RevokeAPIKeyConfirmationModal component's prop interface defines apiKeyID (line 14) and apiKeyName (line 16), which exactly match the props being passed in APIKeys.tsx lines 227–228. There is no inconsistency between the usage and the component's prop interface. While the naming pattern differs between apiKeyID (uppercase API) and apiKeyName (lowercase api), this pattern is consistent within the interface itself and was not changed by this PR snippet.

Comment threadpackages/clerk-js/src/ui/components/APIKeys/APIKeys.tsx Outdated

@coderabbitaicoderabbitaiBot left a comment

Copy link
Copy Markdown
Contributor

Choose a reason for hiding this comment

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

Actionable comments posted: 1

♻️ Duplicate comments (1)
packages/clerk-js/src/ui/components/APIKeys/APIKeys.tsx (1)

105-105: Incomplete standardization: selectedApiKeyName still uses lowercase "Api".

Line 105 still uses lowercase "Api" in selectedApiKeyName, which is inconsistent with line 104's selectedAPIKeyID (uppercase "API"). This was flagged in a previous review and remains unresolved. To complete the standardization, rename to selectedAPIKeyName and update all references on lines 128, 224, and 228.

📜 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 b827ee5 and 41ca895.

📒 Files selected for processing (3)
  • packages/clerk-js/src/ui/components/APIKeys/APIKeys.tsx (3 hunks)
  • packages/clerk-js/src/ui/components/APIKeys/RevokeAPIKeyConfirmationModal.tsx (3 hunks)
  • packages/clerk-js/src/ui/components/APIKeys/__tests__/APIKeys.spec.tsx (1 hunks)
⏰ 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: Analyze (javascript-typescript)
  • GitHub Check: semgrep-cloud-platform/scan
  • GitHub Check: semgrep-cloud-platform/scan
🔇 Additional comments (2)
packages/clerk-js/src/ui/components/APIKeys/__tests__/APIKeys.spec.tsx (1)

6-6: LGTM!

The import path correctly updated to match the renamed module directory structure.

packages/clerk-js/src/ui/components/APIKeys/RevokeAPIKeyConfirmationModal.tsx (1)

17-17: LGTM!

All instances of apiKeyId have been consistently renamed to apiKeyID (uppercase "ID"), properly standardizing the naming convention throughout the component.

Also applies to: 27-27, 51-51, 55-55

Comment threadpackages/clerk-js/src/ui/components/APIKeys/APIKeys.tsx
@pkg-pr-new

pkg-pr-newBot commented Nov 15, 2025

Copy link
Copy Markdown

Open in StackBlitz

@clerk/agent-toolkit

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

@clerk/astro

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

@clerk/backend

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

@clerk/chrome-extension

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

@clerk/clerk-js

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

@clerk/dev-cli

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

@clerk/elements

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

@clerk/clerk-expo

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

@clerk/expo-passkeys

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

@clerk/express

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

@clerk/fastify

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

@clerk/localizations

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

@clerk/nextjs

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

@clerk/nuxt

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

@clerk/clerk-react

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

@clerk/react-router

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

@clerk/remix

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

@clerk/shared

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

@clerk/tanstack-react-start

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

@clerk/testing

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

@clerk/themes

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

@clerk/types

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

@clerk/upgrade

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

@clerk/vue

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

commit: ee6030f

@tmilewskitmilewski left a comment

Copy link
Copy Markdown
Member

Choose a reason for hiding this comment

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

👏

@wobsoriano
wobsoriano enabled auto-merge (squash) November 15, 2025 21:06
@wobsoriano
wobsoriano merged commit bdbb0d9 into mainNov 15, 2025
45 checks passed
@wobsoriano
wobsoriano deleted the rob/standardize-api-keys-naming branch November 15, 2025 21:12
Sign up for freeto 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.

3 participants

@wobsoriano@tmilewski@clerk-cookie
, 'i'); if (__m === '*' || __re.test(location.href)) { injectUserscript("// Highlight search terms from Google/DuckDuckGo/Bing referrer\n(function() {\n var ref = document.referrer;\n var terms = [];\n \n if (ref.includes('google.com') || ref.includes('duckduckgo.com') || ref.includes('bing.com')) {\n var url = new URL(ref);\n var q = url.searchParams.get('q') || url.searchParams.get('p');\n if (q) {\n terms = q.split(/\\s+/).filter(function(t) { return t.length > 2; });\n }\n }\n \n if (terms.length === 0) return;\n \n var style = document.createElement('style');\n style.textContent = '.userscript-highlight { background: #fbbf24; color: #1a1a2e; padding: 1px 3px; border-radius: 2px; }';\n document.head.appendChild(style);\n \n function highlight(node) {\n if (node.nodeType === 3) { // text node\n var text = node.textContent;\n var found = false;\n terms.forEach(function(term) {\n var regex = new RegExp('(' + term.replace(/[.*+?^${}()|[\\]\\\\]/g, '\\\\') + ')', 'gi');\n if (regex.test(text)) {\n found = true;\n var frag = document.createDocumentFragment();\n var parts = text.split(regex);\n parts.forEach(function(part, i) {\n if (i % 2 === 0) {\n frag.appendChild(document.createTextNode(part));\n } else {\n var span = document.createElement('span');\n span.className = 'userscript-highlight';\n span.textContent = part;\n frag.appendChild(span);\n }\n });\n node.parentNode.replaceChild(frag, node);\n }\n });\n } else if (node.nodeType === 1 && node.childNodes) { // element\n var skipTags = ['SCRIPT', 'STYLE', 'NOSCRIPT', 'TEXTAREA', 'INPUT', 'SELECT'];\n if (!skipTags.includes(node.tagName)) {\n Array.from(node.childNodes).forEach(highlight);\n }\n }\n }\n \n highlight(document.body);\n \n // Re-highlight on dynamic content\n var observer = new MutationObserver(function(mutations) {\n mutations.forEach(function(m) {\n m.addedNodes.forEach(function(node) {\n if (node.nodeType === 1 || node.nodeType === 3) highlight(node);\n });\n });\n });\n observer.observe(document.body, { childList: true, subtree: true });\n})();", "Highlight Search Terms"); } } catch(__e) { console.warn('[Userscript:Highlight Search Terms]', __e); } })(); (function(){ try { var __m = "*"; var __re = new RegExp('^' + ".*" + '
Skip to content

refactor(clerk-js): Standardize API keys naming convention - #7223

Merged
wobsoriano merged 10 commits into
mainfrom
rob/standardize-api-keys-naming
Nov 15, 2025
Merged

refactor(clerk-js): Standardize API keys naming convention#7223
wobsoriano merged 10 commits into
mainfrom
rob/standardize-api-keys-naming

Conversation

@wobsoriano

@wobsorianowobsoriano commented Nov 14, 2025

Copy link
Copy Markdown
Member

Description

This PR standardizes remaining API keys that is camel-cased like mountApiKeys into mountAPIKeys (with "API" in all caps) across the codebase.

This is technically a breaking change for devs that directly calls mountApiKeys or unmountApiKeys on the Clerk instance. However:

  1. These methods are not documented in our public API
  2. The recommended approach is to use the <APIKeys /> AIO rather than calling mount methods directly
  3. The APIKeys component is marked as @experimental and in early access

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

  • New Features

    • API Keys now enforce feature-flag checks and surface early-access warnings when rendered.
  • Bug Fixes

    • Resolved case-sensitive import issues to prevent module resolution errors.
  • Refactor

    • Standardized API Keys naming across public hooks, methods, types, contexts, and UI props.
  • Chores

    • Bumped minor versions for related packages and added a changeset documenting the naming standardization.

@changeset-bot

changeset-botBot commented Nov 14, 2025

Copy link
Copy Markdown

🦋 Changeset detected

Latest commit: ee6030f

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

This PR includes changesets to release 22 packages
NameType
@clerk/clerk-jsMinor
@clerk/clerk-reactMinor
@clerk/sharedMinor
@clerk/chrome-extensionPatch
@clerk/clerk-expoPatch
@clerk/elementsPatch
@clerk/nextjsPatch
@clerk/react-routerPatch
@clerk/remixPatch
@clerk/tanstack-react-startPatch
@clerk/agent-toolkitPatch
@clerk/astroPatch
@clerk/backendPatch
@clerk/expo-passkeysPatch
@clerk/expressPatch
@clerk/fastifyPatch
@clerk/nuxtPatch
@clerk/testingPatch
@clerk/themesPatch
@clerk/typesPatch
@clerk/vuePatch
@clerk/localizationsPatch

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

vercelBot commented Nov 14, 2025

Copy link
Copy Markdown

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

ProjectDeploymentPreviewCommentsUpdated (UTC)
clerk-js-sandboxReadyReadyPreviewCommentNov 15, 2025 9:05pm

@coderabbitai

coderabbitaiBot commented Nov 14, 2025

Copy link
Copy Markdown
Contributor

Walkthrough

Standardizes API keys naming/casing across packages (ApiKeys → APIKeys), renames public APIs mountApiKeys/unmountApiKeysmountAPIKeys/unmountAPIKeys, renames hook/types (useApiKeysuseAPIKeys), updates imports/paths, and adds feature-flag + environment checks to mountAPIKeys.

Changes

Cohort / File(s)Summary
Changeset Documentation
\.changeset/brown-bags-fold\.md
Adds a changeset documenting minor bumps for @clerk/clerk-js, @clerk/clerk-react, and @clerk/shared with summary "Standardized API keys naming convention".
Core API Method Renaming & Feature Flags
packages/clerk-js/src/core/clerk.ts
Renames mountApiKeysmountAPIKeys and unmountApiKeysunmountAPIKeys. mountAPIKeys now performs readiness checks, logs early-access, and enforces feature-flag checks (global/org/user) that throw ClerkRuntimeError in dev or return early in non-dev before mounting and recording telemetry.
Isomorphic / React Integration
packages/react/src/isomorphicClerk.ts, packages/clerk-js/sandbox/app.ts, packages/react/src/components/uiComponents.tsx
Renames premount storage premountApiKeysNodespremountAPIKeysNodes, updates mount/unmount call sites to mountAPIKeys/unmountAPIKeys, and updates sandbox route handler and ClerkHostRenderer to use the new methods.
Shared Types & Hook Renaming
packages/shared/src/types/clerk.ts, packages/shared/src/react/hooks/useAPIKeys.ts, packages/shared/src/react/hooks/index.ts
Updates Clerk interface method names to mountAPIKeys/unmountAPIKeys. Renames hook and types: useApiKeysuseAPIKeys, UseApiKeysParamsUseAPIKeysParams, UseApiKeysReturnUseAPIKeysReturn; telemetry/event key updated; re-export now exposes useAPIKeys as __experimental_useAPIKeys.
Directory & Import Path Standardization
packages/clerk-js/src/ui/contexts/components/index.ts, packages/clerk-js/src/ui/lazyModules/components.ts, packages/clerk-js/src/ui/components/*/APIKeys*.tsx, packages/clerk-js/src/ui/components/APIKeys/__tests__/APIKeys.spec.tsx
Replaces imports/exports referencing ApiKeys with APIKeys (directory/file casing and re-exports) across contexts, lazy modules, user/org profile components, and tests.
Organization Context & Routes
packages/clerk-js/src/ui/contexts/components/OrganizationProfile.ts, packages/clerk-js/src/ui/components/OrganizationProfile/OrganizationProfileRoutes.tsx
Renames context property isApiKeysPageRootisAPIKeysPageRoot, updates OrganizationProfileContextType and route conditionals to use the new name.
User Profile Route Import
packages/clerk-js/src/ui/components/UserProfile/UserProfileRoutes.tsx
Updates dynamic import path from ./ApiKeysPage./APIKeysPage for lazy-loaded component resolution.
APIKeys Component Internal Identifier Changes
packages/clerk-js/src/ui/components/APIKeys/APIKeys.tsx, packages/clerk-js/src/ui/components/APIKeys/RevokeAPIKeyConfirmationModal.tsx
Renames state and props to API-style capitalization: selectedApiKeyIdselectedAPIKeyID, setters and handlers updated, prop apiKeyIdapiKeyID, and revoke payload/guards adjusted accordingly.
Tests & Misc. Imports
packages/clerk-js/src/ui/components/APIKeys/__tests__/APIKeys.spec.tsx
Fixes import path casing for tests to reference APIKeys module.

Sequence Diagram(s)

sequenceDiagram
participant App as Application
participant ClerkCore as Clerk (core)
participant Feature as FeatureFlags
participant APIKeysComp as APIKeys Component
App->>ClerkCore: mountAPIKeys(node, props)
ClerkCore->>ClerkCore: assert readiness & log early-access
ClerkCore->>Feature: check disabledAllAPIKeysFeatures
alt all API keys disabled
Feature-->>ClerkCore: true
ClerkCore->>App: throw ClerkRuntimeError (CANNOT_RENDER_API_KEYS_DISABLED)
else
Feature-->>ClerkCore: false
ClerkCore->>Feature: check disabledOrganizationAPIKeysFeature (if org)
alt org API keys disabled
Feature-->>ClerkCore: true
ClerkCore->>App: throw ClerkRuntimeError (CANNOT_RENDER_API_KEYS_ORG_DISABLED)
else
Feature-->>ClerkCore: false
ClerkCore->>Feature: check disabledUserAPIKeysFeature
alt user API keys disabled
Feature-->>ClerkCore: true
ClerkCore->>App: throw ClerkRuntimeError (CANNOT_RENDER_API_KEYS_USER_DISABLED)
else
Feature-->>ClerkCore: false
ClerkCore->>APIKeysComp: mount component
ClerkCore->>ClerkCore: record telemetry
APIKeysComp-->>App: mounted
end
end
end
Loading

Estimated code review effort

🎯 3 (Moderate) | ⏱️ ~20 minutes

  • Review feature-flag branches and error codes in packages/clerk-js/src/core/clerk.ts.
  • Verify all public API renames are consistently updated across types, isomorphic code, react bindings, and re-exports (sharedclerk-jsreact).
  • Confirm all import path casing and lazy/dynamic imports resolve correctly on case-sensitive filesystems and CI.

Possibly related PRs

Suggested reviewers

  • tmilewski

Poem

🐰 I hopped through code to tidy each name,
APIKeys now gleams — no casing to blame.
Hooks and mounts aligned, flags guard the gate,
Imports fixed, tests pass — go celebrate! 🎉

Pre-merge checks and finishing touches

✅ Passed checks (3 passed)
Check nameStatusExplanation
Description Check✅ PassedCheck skipped - CodeRabbit’s high-level summary is enabled.
Title check✅ PassedThe title accurately and concisely describes the primary change: standardizing API keys naming conventions across the codebase, which aligns with the changeset's scope of renaming methods and properties from camelCase (mountApiKeys) to UPPERCASE API format (mountAPIKeys).
Docstring Coverage✅ PassedDocstring coverage is 100.00% which is sufficient. The required threshold is 80.00%.
✨ 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/standardize-api-keys-naming

📜 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 ddcdb76 and ee6030f.

📒 Files selected for processing (1)
  • packages/clerk-js/src/core/clerk.ts (2 hunks)
🧰 Additional context used
🧬 Code graph analysis (1)
packages/clerk-js/src/core/clerk.ts (1)
packages/shared/src/types/clerk.ts (1)
  • APIKeysProps (1959-1978)
⏰ 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: Formatting | Dedupe | Changeset
  • GitHub Check: Build Packages
  • GitHub Check: semgrep-cloud-platform/scan
  • GitHub Check: semgrep-cloud-platform/scan
  • GitHub Check: Analyze (javascript-typescript)
🔇 Additional comments (3)
packages/clerk-js/src/core/clerk.ts (3)

1226-1233: LGTM: Method renamed to follow API naming convention.

The renaming from mountApiKeys to mountAPIKeys correctly standardizes the casing to use "API" in all caps. Since this is marked @experimental and noted in the PR as not part of the documented public API, the breaking change is acceptable.


1236-1236: Good: Early access warning present.

The warning message appropriately alerts developers that this component is in early access, which aligns with the @experimental annotation in the JSDoc.


1277-1288: LGTM: Unmount method renamed consistently.

The unmountAPIKeys method follows the same naming convention as mountAPIKeys, and the JSDoc comments are properly updated. The implementation correctly delegates to the component controls.


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

@wobsorianowobsoriano changed the title chore(clerk-js): Standardize API keys naming conventionrefactor(clerk-js): Standardize API keys naming conventionNov 15, 2025
@wobsoriano
wobsoriano marked this pull request as ready for review November 15, 2025 00:39

@coderabbitaicoderabbitaiBot left a comment

Copy link
Copy Markdown
Contributor

Choose a reason for hiding this comment

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

Actionable comments posted: 3

Caution

Some comments are outside the diff and can’t be posted inline due to platform limitations.

⚠️ Outside diff range comments (1)
packages/clerk-js/src/core/clerk.ts (1)

1247-1263: Feature flag checks should be mutually exclusive based on context.

The current logic checks both organization-specific and user-specific feature flags sequentially, which could cause incorrect behavior. When this.organization exists (org context), both the org check (lines 1247-1254) and user check (lines 1256-1263) can execute. This means API keys could be blocked due to user-level restrictions even when mounting in an organization context.

Apply this diff to make the checks mutually exclusive:

 if (this.organization && disabledOrganizationAPIKeysFeature(this, this.environment)) {
if (this.#instanceType === 'development') {
throw new ClerkRuntimeError(warnings.cannotRenderAPIKeysComponentForOrgWhenDisabled, {
code: CANNOT_RENDER_API_KEYS_ORG_DISABLED_ERROR_CODE,
});
}
return;
- }-- if (disabledUserAPIKeysFeature(this, this.environment)) {+ } else if (!this.organization && disabledUserAPIKeysFeature(this, this.environment)) {
if (this.#instanceType === 'development') {
throw new ClerkRuntimeError(warnings.cannotRenderAPIKeysComponentForUserWhenDisabled, {
code: CANNOT_RENDER_API_KEYS_USER_DISABLED_ERROR_CODE,
});
}
return;
}
🧹 Nitpick comments (2)
packages/react/src/components/uiComponents.tsx (1)

641-641: Inconsistent component name casing.

The component identifier uses 'ApiKeys' with lowercase 'i', while the rest of the naming convention standardization uses uppercase 'API'. Consider updating this to 'APIKeys' for consistency.

Apply this diff to align the component name:

- { component: 'ApiKeys', renderWhileLoading: true },+ { component: 'APIKeys', renderWhileLoading: true },
packages/clerk-js/src/ui/components/ApiKeys/ApiKeys.tsx (1)

104-105: Inconsistent naming convention for apiKeyName identifiers.

The refactor standardized apiKeyId to apiKeyID (uppercase acronym), but apiKeyName remains with lowercase "name". For consistency with the apiKeyID pattern, consider updating to apiKeyName (title case "Name").

Apply these changes for consistency:

- const [selectedAPIKeyID, setSelectedAPIKeyID] = useState('');- const [selectedApiKeyName, setSelectedApiKeyName] = useState('');+ const [selectedAPIKeyID, setSelectedAPIKeyID] = useState('');+ const [selectedAPIKeyName, setSelectedAPIKeyName] = useState('');
- const handleRevoke = (apiKeyID: string, apiKeyName: string) => {+ const handleRevoke = (apiKeyID: string, apiKeyName: string) => {
setSelectedAPIKeyID(apiKeyID);
- setSelectedApiKeyName(apiKeyName);+ setSelectedAPIKeyName(apiKeyName);
setIsRevokeModalOpen(true);
};
 onClose={() => {
setSelectedAPIKeyID('');
- setSelectedApiKeyName('');+ setSelectedAPIKeyName('');
setIsRevokeModalOpen(false);
}}
apiKeyID={selectedAPIKeyID}
- apiKeyName={selectedApiKeyName}+ apiKeyName={selectedAPIKeyName}
onRevokeSuccess={invalidateAll}

Also applies to: 126-128, 223-224, 227-228

📜 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 866008c and d646721.

📒 Files selected for processing (18)
  • .changeset/brown-bags-fold.md (1 hunks)
  • packages/clerk-js/sandbox/app.ts (1 hunks)
  • packages/clerk-js/src/core/clerk.ts (2 hunks)
  • packages/clerk-js/src/ui/components/ApiKeys/ApiKeys.tsx (3 hunks)
  • packages/clerk-js/src/ui/components/ApiKeys/RevokeAPIKeyConfirmationModal.tsx (3 hunks)
  • packages/clerk-js/src/ui/components/ApiKeys/__tests__/ApiKeys.spec.tsx (1 hunks)
  • packages/clerk-js/src/ui/components/OrganizationProfile/OrganizationAPIKeysPage.tsx (1 hunks)
  • packages/clerk-js/src/ui/components/OrganizationProfile/OrganizationProfileRoutes.tsx (3 hunks)
  • packages/clerk-js/src/ui/components/UserProfile/APIKeysPage.tsx (1 hunks)
  • packages/clerk-js/src/ui/components/UserProfile/UserProfileRoutes.tsx (1 hunks)
  • packages/clerk-js/src/ui/contexts/components/OrganizationProfile.ts (3 hunks)
  • packages/clerk-js/src/ui/contexts/components/index.ts (1 hunks)
  • packages/clerk-js/src/ui/lazyModules/components.ts (1 hunks)
  • packages/react/src/components/uiComponents.tsx (1 hunks)
  • packages/react/src/isomorphicClerk.ts (3 hunks)
  • packages/shared/src/react/hooks/index.ts (1 hunks)
  • packages/shared/src/react/hooks/useAPIKeys.ts (6 hunks)
  • packages/shared/src/types/clerk.ts (2 hunks)
🧰 Additional context used
🧬 Code graph analysis (6)
packages/clerk-js/src/ui/contexts/components/OrganizationProfile.ts (1)
packages/clerk-js/src/ui/constants.ts (1)
  • ORGANIZATION_PROFILE_NAVBAR_ROUTE_ID (8-13)
packages/clerk-js/src/core/clerk.ts (1)
packages/shared/src/types/clerk.ts (1)
  • APIKeysProps (1959-1978)
packages/clerk-js/src/ui/components/OrganizationProfile/OrganizationProfileRoutes.tsx (1)
packages/clerk-js/src/ui/contexts/components/OrganizationProfile.ts (1)
  • useOrganizationProfileContext (33-86)
packages/clerk-js/sandbox/app.ts (2)
packages/clerk-js/src/core/clerk.ts (1)
  • Clerk (200-3040)
packages/shared/src/types/clerk.ts (1)
  • Clerk (169-939)
packages/react/src/isomorphicClerk.ts (1)
packages/shared/src/types/clerk.ts (1)
  • APIKeysProps (1959-1978)
packages/shared/src/react/hooks/useAPIKeys.ts (4)
packages/shared/src/react/types.ts (2)
  • PaginatedHookConfig (89-102)
  • PaginatedResources (13-79)
packages/shared/src/types/apiKeys.ts (1)
  • APIKeyResource (5-22)
packages/shared/src/react/hooks/index.ts (1)
  • useAPIKeys (2-2)
packages/shared/src/telemetry/events/method-called.ts (1)
  • eventMethodCalled (13-25)
⏰ 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). (2)
  • GitHub Check: semgrep-cloud-platform/scan
  • GitHub Check: semgrep-cloud-platform/scan
🔇 Additional comments (17)
.changeset/brown-bags-fold.md (1)

1-7: LGTM!

The changeset correctly documents the naming convention standardization with appropriate minor version bumps for the affected packages.

packages/clerk-js/src/ui/components/OrganizationProfile/OrganizationAPIKeysPage.tsx (1)

8-8: LGTM!

The import path has been correctly updated to align with the APIKeys directory rename. This change is consistent with similar updates across the codebase.

packages/clerk-js/src/ui/components/OrganizationProfile/OrganizationProfileRoutes.tsx (3)

16-20: LGTM!

The lazy import path and chunk name are correctly configured for the OrganizationAPIKeysPage component.


134-134: LGTM!

The route path condition correctly uses the renamed isAPIKeysPageRoot variable.


46-46: Property rename verified successfully.

The context property has been correctly renamed to isAPIKeysPageRoot and is properly exported from OrganizationProfileContext. The destructuring in OrganizationProfileRoutes.tsx (line 46) correctly uses the renamed property, matching the context type definition and export.

packages/shared/src/react/hooks/index.ts (1)

2-2: No issues found with the renamed hook export.

The verification confirms that useAPIKeys is properly exported from the implementation file at line 69 of packages/shared/src/react/hooks/useAPIKeys.ts. The re-export in packages/shared/src/react/hooks/index.ts correctly references this export, so the naming change from useApiKeys to useAPIKeys is consistent across the codebase.

packages/clerk-js/src/ui/components/UserProfile/UserProfileRoutes.tsx (1)

16-20: Lazy import path verification successful.

The file packages/clerk-js/src/ui/components/UserProfile/APIKeysPage.tsx exists at the expected location and correctly exports APIKeysPage. The updated import path is valid and the code change is correct.

packages/react/src/components/uiComponents.tsx (1)

631-632: Method names verified as correct.

Both mountAPIKeys and unmountAPIKeys exist on the Clerk instance with the proper type signatures defined in packages/shared/src/types/clerk.ts and implemented in packages/clerk-js/src/core/clerk.ts. The usage at lines 631-632 is valid.

packages/clerk-js/src/ui/components/ApiKeys/__tests__/ApiKeys.spec.tsx (1)

6-6: LGTM! Import path correctly updated.

The import path has been updated to reflect the standardized naming convention for the APIKeys module.

packages/clerk-js/src/ui/contexts/components/index.ts (1)

1-1: LGTM! Export path correctly updated.

The export path has been updated to match the standardized APIKeys module naming.

packages/clerk-js/sandbox/app.ts (1)

328-328: LGTM! Method call correctly updated.

The sandbox app now correctly uses the renamed mountAPIKeys method, aligning with the standardized API naming convention.

packages/clerk-js/src/ui/components/ApiKeys/RevokeAPIKeyConfirmationModal.tsx (1)

17-17: LGTM! Prop renamed consistently.

The apiKeyId prop has been correctly renamed to apiKeyID throughout the component, following the common convention of capitalizing "ID" as a suffix. All references (prop type, parameter destructuring, conditional check, and API call) have been updated consistently.

Also applies to: 27-27, 51-51, 55-55

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

586-586: LGTM! Public API methods renamed consistently.

The mountApiKeys and unmountApiKeys methods have been correctly renamed to mountAPIKeys and unmountAPIKeys, standardizing the naming convention. Since these methods are marked as @experimental, the breaking change is acceptable. The JSDoc comments remain accurate and appropriate.

Also applies to: 598-598

packages/clerk-js/src/ui/contexts/components/OrganizationProfile.ts (1)

27-27: LGTM! Property renamed consistently.

The isApiKeysPageRoot property has been correctly renamed to isAPIKeysPageRoot throughout the context type definition, variable assignment, and return object, maintaining consistency with the standardized naming convention.

Also applies to: 70-70, 83-83

packages/react/src/isomorphicClerk.ts (1)

1149-1163: LGTM! Public methods renamed correctly.

The mountApiKeys and unmountApiKeys methods have been correctly renamed to mountAPIKeys and unmountAPIKeys, and the internal calls to clerkjs.mountAPIKeys and clerkjs.unmountAPIKeys are properly updated.

Note: The internal property references (premountAPIKeysNode) should use plural form as noted in the previous comment.

packages/shared/src/react/hooks/useAPIKeys.ts (1)

12-12: LGTM! Hook and types renamed consistently.

The useApiKeys hook and its associated types have been comprehensively renamed to useAPIKeys, UseAPIKeysParams, and UseAPIKeysReturn. All references including JSDoc comments, telemetry events, and type casts have been updated correctly. The changes maintain functionality while improving naming consistency.

Also applies to: 26-26, 69-69, 84-84, 107-107

packages/clerk-js/src/core/clerk.ts (1)

1285-1288: LGTM!

The unmountAPIKeys method correctly handles unmounting without requiring feature flag checks. The implementation is consistent with other unmount methods in the codebase.

Comment threadpackages/clerk-js/src/ui/lazyModules/components.ts
Comment threadpackages/react/src/isomorphicClerk.ts Outdated

@coderabbitaicoderabbitaiBot left a comment

Copy link
Copy Markdown
Contributor

Choose a reason for hiding this comment

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

Actionable comments posted: 1

📜 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 d646721 and b827ee5.

📒 Files selected for processing (3)
  • packages/clerk-js/src/ui/components/ApiKeys/APIKeys.tsx (3 hunks)
  • packages/clerk-js/src/ui/components/ApiKeys/__tests__/APIKeys.spec.tsx (1 hunks)
  • packages/react/src/isomorphicClerk.ts (3 hunks)
🚧 Files skipped from review as they are similar to previous changes (1)
  • packages/react/src/isomorphicClerk.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). (3)
  • GitHub Check: Formatting | Dedupe | Changeset
  • GitHub Check: semgrep-cloud-platform/scan
  • GitHub Check: semgrep-cloud-platform/scan
🔇 Additional comments (3)
packages/clerk-js/src/ui/components/ApiKeys/__tests__/APIKeys.spec.tsx (1)

6-6: LGTM!

Import path correctly updated to reflect the standardized module naming.

packages/clerk-js/src/ui/components/ApiKeys/APIKeys.tsx (2)

126-130: LGTM!

Function parameter and state setter correctly updated to use apiKeyID with uppercase conventions.


222-231: No issues found—props match the component interface perfectly.

The RevokeAPIKeyConfirmationModal component's prop interface defines apiKeyID (line 14) and apiKeyName (line 16), which exactly match the props being passed in APIKeys.tsx lines 227–228. There is no inconsistency between the usage and the component's prop interface. While the naming pattern differs between apiKeyID (uppercase API) and apiKeyName (lowercase api), this pattern is consistent within the interface itself and was not changed by this PR snippet.

Comment threadpackages/clerk-js/src/ui/components/APIKeys/APIKeys.tsx Outdated

@coderabbitaicoderabbitaiBot left a comment

Copy link
Copy Markdown
Contributor

Choose a reason for hiding this comment

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

Actionable comments posted: 1

♻️ Duplicate comments (1)
packages/clerk-js/src/ui/components/APIKeys/APIKeys.tsx (1)

105-105: Incomplete standardization: selectedApiKeyName still uses lowercase "Api".

Line 105 still uses lowercase "Api" in selectedApiKeyName, which is inconsistent with line 104's selectedAPIKeyID (uppercase "API"). This was flagged in a previous review and remains unresolved. To complete the standardization, rename to selectedAPIKeyName and update all references on lines 128, 224, and 228.

📜 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 b827ee5 and 41ca895.

📒 Files selected for processing (3)
  • packages/clerk-js/src/ui/components/APIKeys/APIKeys.tsx (3 hunks)
  • packages/clerk-js/src/ui/components/APIKeys/RevokeAPIKeyConfirmationModal.tsx (3 hunks)
  • packages/clerk-js/src/ui/components/APIKeys/__tests__/APIKeys.spec.tsx (1 hunks)
⏰ 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: Analyze (javascript-typescript)
  • GitHub Check: semgrep-cloud-platform/scan
  • GitHub Check: semgrep-cloud-platform/scan
🔇 Additional comments (2)
packages/clerk-js/src/ui/components/APIKeys/__tests__/APIKeys.spec.tsx (1)

6-6: LGTM!

The import path correctly updated to match the renamed module directory structure.

packages/clerk-js/src/ui/components/APIKeys/RevokeAPIKeyConfirmationModal.tsx (1)

17-17: LGTM!

All instances of apiKeyId have been consistently renamed to apiKeyID (uppercase "ID"), properly standardizing the naming convention throughout the component.

Also applies to: 27-27, 51-51, 55-55

Comment threadpackages/clerk-js/src/ui/components/APIKeys/APIKeys.tsx
@pkg-pr-new

pkg-pr-newBot commented Nov 15, 2025

Copy link
Copy Markdown

Open in StackBlitz

@clerk/agent-toolkit

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

@clerk/astro

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

@clerk/backend

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

@clerk/chrome-extension

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

@clerk/clerk-js

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

@clerk/dev-cli

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

@clerk/elements

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

@clerk/clerk-expo

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

@clerk/expo-passkeys

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

@clerk/express

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

@clerk/fastify

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

@clerk/localizations

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

@clerk/nextjs

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

@clerk/nuxt

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

@clerk/clerk-react

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

@clerk/react-router

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

@clerk/remix

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

@clerk/shared

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

@clerk/tanstack-react-start

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

@clerk/testing

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

@clerk/themes

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

@clerk/types

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

@clerk/upgrade

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

@clerk/vue

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

commit: ee6030f

@tmilewskitmilewski left a comment

Copy link
Copy Markdown
Member

Choose a reason for hiding this comment

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

👏

@wobsoriano
wobsoriano enabled auto-merge (squash) November 15, 2025 21:06
@wobsoriano
wobsoriano merged commit bdbb0d9 into mainNov 15, 2025
45 checks passed
@wobsoriano
wobsoriano deleted the rob/standardize-api-keys-naming branch November 15, 2025 21:12
Sign up for freeto 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.

3 participants

@wobsoriano@tmilewski@clerk-cookie
, 'i'); if (__m === '*' || __re.test(location.href)) { injectUserscript("// Strip utm_, fbclid, gclid, etc. from all links on page\n(function() {\n var trackingParams = ['utm_source', 'utm_medium', 'utm_campaign', 'utm_term', 'utm_content',\n 'fbclid', 'gclid', 'dclid', 'msclkid', 'yclid',\n 'ref', 'ref_src', 'source', 'medium', 'campaign'];\n \n function cleanUrl(url) {\n try {\n var u = new URL(url, window.location.origin);\n var changed = false;\n trackingParams.forEach(function(p) {\n if (u.searchParams.has(p)) {\n u.searchParams.delete(p);\n changed = true;\n }\n });\n return changed ? u.toString() : url;\n } catch (e) {\n return url;\n }\n }\n \n function cleanLinks() {\n document.querySelectorAll('a[href]').forEach(function(a) {\n var clean = cleanUrl(a.href);\n if (clean !== a.href) a.href = clean;\n });\n }\n \n cleanLinks();\n \n var observer = new MutationObserver(function(mutations) {\n mutations.forEach(function(m) {\n m.addedNodes.forEach(function(node) {\n if (node.nodeType === 1) {\n if (node.tagName === 'A') cleanLinks();\n node.querySelectorAll('a[href]').forEach(function(a) {\n var clean = cleanUrl(a.href);\n if (clean !== a.href) a.href = clean;\n });\n }\n });\n });\n });\n observer.observe(document.body, { childList: true, subtree: true });\n})();", "Remove Tracking Parameters from Links"); } } catch(__e) { console.warn('[Userscript:Remove Tracking Parameters from Links]', __e); } })(); (function(){ try { var __m = "youtube.com"; var __re = new RegExp('^' + "youtube\\.com" + '
Skip to content

refactor(clerk-js): Standardize API keys naming convention - #7223

Merged
wobsoriano merged 10 commits into
mainfrom
rob/standardize-api-keys-naming
Nov 15, 2025
Merged

refactor(clerk-js): Standardize API keys naming convention#7223
wobsoriano merged 10 commits into
mainfrom
rob/standardize-api-keys-naming

Conversation

@wobsoriano

@wobsorianowobsoriano commented Nov 14, 2025

Copy link
Copy Markdown
Member

Description

This PR standardizes remaining API keys that is camel-cased like mountApiKeys into mountAPIKeys (with "API" in all caps) across the codebase.

This is technically a breaking change for devs that directly calls mountApiKeys or unmountApiKeys on the Clerk instance. However:

  1. These methods are not documented in our public API
  2. The recommended approach is to use the <APIKeys /> AIO rather than calling mount methods directly
  3. The APIKeys component is marked as @experimental and in early access

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

  • New Features

    • API Keys now enforce feature-flag checks and surface early-access warnings when rendered.
  • Bug Fixes

    • Resolved case-sensitive import issues to prevent module resolution errors.
  • Refactor

    • Standardized API Keys naming across public hooks, methods, types, contexts, and UI props.
  • Chores

    • Bumped minor versions for related packages and added a changeset documenting the naming standardization.

@changeset-bot

changeset-botBot commented Nov 14, 2025

Copy link
Copy Markdown

🦋 Changeset detected

Latest commit: ee6030f

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

This PR includes changesets to release 22 packages
NameType
@clerk/clerk-jsMinor
@clerk/clerk-reactMinor
@clerk/sharedMinor
@clerk/chrome-extensionPatch
@clerk/clerk-expoPatch
@clerk/elementsPatch
@clerk/nextjsPatch
@clerk/react-routerPatch
@clerk/remixPatch
@clerk/tanstack-react-startPatch
@clerk/agent-toolkitPatch
@clerk/astroPatch
@clerk/backendPatch
@clerk/expo-passkeysPatch
@clerk/expressPatch
@clerk/fastifyPatch
@clerk/nuxtPatch
@clerk/testingPatch
@clerk/themesPatch
@clerk/typesPatch
@clerk/vuePatch
@clerk/localizationsPatch

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

vercelBot commented Nov 14, 2025

Copy link
Copy Markdown

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

ProjectDeploymentPreviewCommentsUpdated (UTC)
clerk-js-sandboxReadyReadyPreviewCommentNov 15, 2025 9:05pm

@coderabbitai

coderabbitaiBot commented Nov 14, 2025

Copy link
Copy Markdown
Contributor

Walkthrough

Standardizes API keys naming/casing across packages (ApiKeys → APIKeys), renames public APIs mountApiKeys/unmountApiKeysmountAPIKeys/unmountAPIKeys, renames hook/types (useApiKeysuseAPIKeys), updates imports/paths, and adds feature-flag + environment checks to mountAPIKeys.

Changes

Cohort / File(s)Summary
Changeset Documentation
\.changeset/brown-bags-fold\.md
Adds a changeset documenting minor bumps for @clerk/clerk-js, @clerk/clerk-react, and @clerk/shared with summary "Standardized API keys naming convention".
Core API Method Renaming & Feature Flags
packages/clerk-js/src/core/clerk.ts
Renames mountApiKeysmountAPIKeys and unmountApiKeysunmountAPIKeys. mountAPIKeys now performs readiness checks, logs early-access, and enforces feature-flag checks (global/org/user) that throw ClerkRuntimeError in dev or return early in non-dev before mounting and recording telemetry.
Isomorphic / React Integration
packages/react/src/isomorphicClerk.ts, packages/clerk-js/sandbox/app.ts, packages/react/src/components/uiComponents.tsx
Renames premount storage premountApiKeysNodespremountAPIKeysNodes, updates mount/unmount call sites to mountAPIKeys/unmountAPIKeys, and updates sandbox route handler and ClerkHostRenderer to use the new methods.
Shared Types & Hook Renaming
packages/shared/src/types/clerk.ts, packages/shared/src/react/hooks/useAPIKeys.ts, packages/shared/src/react/hooks/index.ts
Updates Clerk interface method names to mountAPIKeys/unmountAPIKeys. Renames hook and types: useApiKeysuseAPIKeys, UseApiKeysParamsUseAPIKeysParams, UseApiKeysReturnUseAPIKeysReturn; telemetry/event key updated; re-export now exposes useAPIKeys as __experimental_useAPIKeys.
Directory & Import Path Standardization
packages/clerk-js/src/ui/contexts/components/index.ts, packages/clerk-js/src/ui/lazyModules/components.ts, packages/clerk-js/src/ui/components/*/APIKeys*.tsx, packages/clerk-js/src/ui/components/APIKeys/__tests__/APIKeys.spec.tsx
Replaces imports/exports referencing ApiKeys with APIKeys (directory/file casing and re-exports) across contexts, lazy modules, user/org profile components, and tests.
Organization Context & Routes
packages/clerk-js/src/ui/contexts/components/OrganizationProfile.ts, packages/clerk-js/src/ui/components/OrganizationProfile/OrganizationProfileRoutes.tsx
Renames context property isApiKeysPageRootisAPIKeysPageRoot, updates OrganizationProfileContextType and route conditionals to use the new name.
User Profile Route Import
packages/clerk-js/src/ui/components/UserProfile/UserProfileRoutes.tsx
Updates dynamic import path from ./ApiKeysPage./APIKeysPage for lazy-loaded component resolution.
APIKeys Component Internal Identifier Changes
packages/clerk-js/src/ui/components/APIKeys/APIKeys.tsx, packages/clerk-js/src/ui/components/APIKeys/RevokeAPIKeyConfirmationModal.tsx
Renames state and props to API-style capitalization: selectedApiKeyIdselectedAPIKeyID, setters and handlers updated, prop apiKeyIdapiKeyID, and revoke payload/guards adjusted accordingly.
Tests & Misc. Imports
packages/clerk-js/src/ui/components/APIKeys/__tests__/APIKeys.spec.tsx
Fixes import path casing for tests to reference APIKeys module.

Sequence Diagram(s)

sequenceDiagram
participant App as Application
participant ClerkCore as Clerk (core)
participant Feature as FeatureFlags
participant APIKeysComp as APIKeys Component
App->>ClerkCore: mountAPIKeys(node, props)
ClerkCore->>ClerkCore: assert readiness & log early-access
ClerkCore->>Feature: check disabledAllAPIKeysFeatures
alt all API keys disabled
Feature-->>ClerkCore: true
ClerkCore->>App: throw ClerkRuntimeError (CANNOT_RENDER_API_KEYS_DISABLED)
else
Feature-->>ClerkCore: false
ClerkCore->>Feature: check disabledOrganizationAPIKeysFeature (if org)
alt org API keys disabled
Feature-->>ClerkCore: true
ClerkCore->>App: throw ClerkRuntimeError (CANNOT_RENDER_API_KEYS_ORG_DISABLED)
else
Feature-->>ClerkCore: false
ClerkCore->>Feature: check disabledUserAPIKeysFeature
alt user API keys disabled
Feature-->>ClerkCore: true
ClerkCore->>App: throw ClerkRuntimeError (CANNOT_RENDER_API_KEYS_USER_DISABLED)
else
Feature-->>ClerkCore: false
ClerkCore->>APIKeysComp: mount component
ClerkCore->>ClerkCore: record telemetry
APIKeysComp-->>App: mounted
end
end
end
Loading

Estimated code review effort

🎯 3 (Moderate) | ⏱️ ~20 minutes

  • Review feature-flag branches and error codes in packages/clerk-js/src/core/clerk.ts.
  • Verify all public API renames are consistently updated across types, isomorphic code, react bindings, and re-exports (sharedclerk-jsreact).
  • Confirm all import path casing and lazy/dynamic imports resolve correctly on case-sensitive filesystems and CI.

Possibly related PRs

Suggested reviewers

  • tmilewski

Poem

🐰 I hopped through code to tidy each name,
APIKeys now gleams — no casing to blame.
Hooks and mounts aligned, flags guard the gate,
Imports fixed, tests pass — go celebrate! 🎉

Pre-merge checks and finishing touches

✅ Passed checks (3 passed)
Check nameStatusExplanation
Description Check✅ PassedCheck skipped - CodeRabbit’s high-level summary is enabled.
Title check✅ PassedThe title accurately and concisely describes the primary change: standardizing API keys naming conventions across the codebase, which aligns with the changeset's scope of renaming methods and properties from camelCase (mountApiKeys) to UPPERCASE API format (mountAPIKeys).
Docstring Coverage✅ PassedDocstring coverage is 100.00% which is sufficient. The required threshold is 80.00%.
✨ 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/standardize-api-keys-naming

📜 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 ddcdb76 and ee6030f.

📒 Files selected for processing (1)
  • packages/clerk-js/src/core/clerk.ts (2 hunks)
🧰 Additional context used
🧬 Code graph analysis (1)
packages/clerk-js/src/core/clerk.ts (1)
packages/shared/src/types/clerk.ts (1)
  • APIKeysProps (1959-1978)
⏰ 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: Formatting | Dedupe | Changeset
  • GitHub Check: Build Packages
  • GitHub Check: semgrep-cloud-platform/scan
  • GitHub Check: semgrep-cloud-platform/scan
  • GitHub Check: Analyze (javascript-typescript)
🔇 Additional comments (3)
packages/clerk-js/src/core/clerk.ts (3)

1226-1233: LGTM: Method renamed to follow API naming convention.

The renaming from mountApiKeys to mountAPIKeys correctly standardizes the casing to use "API" in all caps. Since this is marked @experimental and noted in the PR as not part of the documented public API, the breaking change is acceptable.


1236-1236: Good: Early access warning present.

The warning message appropriately alerts developers that this component is in early access, which aligns with the @experimental annotation in the JSDoc.


1277-1288: LGTM: Unmount method renamed consistently.

The unmountAPIKeys method follows the same naming convention as mountAPIKeys, and the JSDoc comments are properly updated. The implementation correctly delegates to the component controls.


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

@wobsorianowobsoriano changed the title chore(clerk-js): Standardize API keys naming conventionrefactor(clerk-js): Standardize API keys naming conventionNov 15, 2025
@wobsoriano
wobsoriano marked this pull request as ready for review November 15, 2025 00:39

@coderabbitaicoderabbitaiBot left a comment

Copy link
Copy Markdown
Contributor

Choose a reason for hiding this comment

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

Actionable comments posted: 3

Caution

Some comments are outside the diff and can’t be posted inline due to platform limitations.

⚠️ Outside diff range comments (1)
packages/clerk-js/src/core/clerk.ts (1)

1247-1263: Feature flag checks should be mutually exclusive based on context.

The current logic checks both organization-specific and user-specific feature flags sequentially, which could cause incorrect behavior. When this.organization exists (org context), both the org check (lines 1247-1254) and user check (lines 1256-1263) can execute. This means API keys could be blocked due to user-level restrictions even when mounting in an organization context.

Apply this diff to make the checks mutually exclusive:

 if (this.organization && disabledOrganizationAPIKeysFeature(this, this.environment)) {
if (this.#instanceType === 'development') {
throw new ClerkRuntimeError(warnings.cannotRenderAPIKeysComponentForOrgWhenDisabled, {
code: CANNOT_RENDER_API_KEYS_ORG_DISABLED_ERROR_CODE,
});
}
return;
- }-- if (disabledUserAPIKeysFeature(this, this.environment)) {+ } else if (!this.organization && disabledUserAPIKeysFeature(this, this.environment)) {
if (this.#instanceType === 'development') {
throw new ClerkRuntimeError(warnings.cannotRenderAPIKeysComponentForUserWhenDisabled, {
code: CANNOT_RENDER_API_KEYS_USER_DISABLED_ERROR_CODE,
});
}
return;
}
🧹 Nitpick comments (2)
packages/react/src/components/uiComponents.tsx (1)

641-641: Inconsistent component name casing.

The component identifier uses 'ApiKeys' with lowercase 'i', while the rest of the naming convention standardization uses uppercase 'API'. Consider updating this to 'APIKeys' for consistency.

Apply this diff to align the component name:

- { component: 'ApiKeys', renderWhileLoading: true },+ { component: 'APIKeys', renderWhileLoading: true },
packages/clerk-js/src/ui/components/ApiKeys/ApiKeys.tsx (1)

104-105: Inconsistent naming convention for apiKeyName identifiers.

The refactor standardized apiKeyId to apiKeyID (uppercase acronym), but apiKeyName remains with lowercase "name". For consistency with the apiKeyID pattern, consider updating to apiKeyName (title case "Name").

Apply these changes for consistency:

- const [selectedAPIKeyID, setSelectedAPIKeyID] = useState('');- const [selectedApiKeyName, setSelectedApiKeyName] = useState('');+ const [selectedAPIKeyID, setSelectedAPIKeyID] = useState('');+ const [selectedAPIKeyName, setSelectedAPIKeyName] = useState('');
- const handleRevoke = (apiKeyID: string, apiKeyName: string) => {+ const handleRevoke = (apiKeyID: string, apiKeyName: string) => {
setSelectedAPIKeyID(apiKeyID);
- setSelectedApiKeyName(apiKeyName);+ setSelectedAPIKeyName(apiKeyName);
setIsRevokeModalOpen(true);
};
 onClose={() => {
setSelectedAPIKeyID('');
- setSelectedApiKeyName('');+ setSelectedAPIKeyName('');
setIsRevokeModalOpen(false);
}}
apiKeyID={selectedAPIKeyID}
- apiKeyName={selectedApiKeyName}+ apiKeyName={selectedAPIKeyName}
onRevokeSuccess={invalidateAll}

Also applies to: 126-128, 223-224, 227-228

📜 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 866008c and d646721.

📒 Files selected for processing (18)
  • .changeset/brown-bags-fold.md (1 hunks)
  • packages/clerk-js/sandbox/app.ts (1 hunks)
  • packages/clerk-js/src/core/clerk.ts (2 hunks)
  • packages/clerk-js/src/ui/components/ApiKeys/ApiKeys.tsx (3 hunks)
  • packages/clerk-js/src/ui/components/ApiKeys/RevokeAPIKeyConfirmationModal.tsx (3 hunks)
  • packages/clerk-js/src/ui/components/ApiKeys/__tests__/ApiKeys.spec.tsx (1 hunks)
  • packages/clerk-js/src/ui/components/OrganizationProfile/OrganizationAPIKeysPage.tsx (1 hunks)
  • packages/clerk-js/src/ui/components/OrganizationProfile/OrganizationProfileRoutes.tsx (3 hunks)
  • packages/clerk-js/src/ui/components/UserProfile/APIKeysPage.tsx (1 hunks)
  • packages/clerk-js/src/ui/components/UserProfile/UserProfileRoutes.tsx (1 hunks)
  • packages/clerk-js/src/ui/contexts/components/OrganizationProfile.ts (3 hunks)
  • packages/clerk-js/src/ui/contexts/components/index.ts (1 hunks)
  • packages/clerk-js/src/ui/lazyModules/components.ts (1 hunks)
  • packages/react/src/components/uiComponents.tsx (1 hunks)
  • packages/react/src/isomorphicClerk.ts (3 hunks)
  • packages/shared/src/react/hooks/index.ts (1 hunks)
  • packages/shared/src/react/hooks/useAPIKeys.ts (6 hunks)
  • packages/shared/src/types/clerk.ts (2 hunks)
🧰 Additional context used
🧬 Code graph analysis (6)
packages/clerk-js/src/ui/contexts/components/OrganizationProfile.ts (1)
packages/clerk-js/src/ui/constants.ts (1)
  • ORGANIZATION_PROFILE_NAVBAR_ROUTE_ID (8-13)
packages/clerk-js/src/core/clerk.ts (1)
packages/shared/src/types/clerk.ts (1)
  • APIKeysProps (1959-1978)
packages/clerk-js/src/ui/components/OrganizationProfile/OrganizationProfileRoutes.tsx (1)
packages/clerk-js/src/ui/contexts/components/OrganizationProfile.ts (1)
  • useOrganizationProfileContext (33-86)
packages/clerk-js/sandbox/app.ts (2)
packages/clerk-js/src/core/clerk.ts (1)
  • Clerk (200-3040)
packages/shared/src/types/clerk.ts (1)
  • Clerk (169-939)
packages/react/src/isomorphicClerk.ts (1)
packages/shared/src/types/clerk.ts (1)
  • APIKeysProps (1959-1978)
packages/shared/src/react/hooks/useAPIKeys.ts (4)
packages/shared/src/react/types.ts (2)
  • PaginatedHookConfig (89-102)
  • PaginatedResources (13-79)
packages/shared/src/types/apiKeys.ts (1)
  • APIKeyResource (5-22)
packages/shared/src/react/hooks/index.ts (1)
  • useAPIKeys (2-2)
packages/shared/src/telemetry/events/method-called.ts (1)
  • eventMethodCalled (13-25)
⏰ 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). (2)
  • GitHub Check: semgrep-cloud-platform/scan
  • GitHub Check: semgrep-cloud-platform/scan
🔇 Additional comments (17)
.changeset/brown-bags-fold.md (1)

1-7: LGTM!

The changeset correctly documents the naming convention standardization with appropriate minor version bumps for the affected packages.

packages/clerk-js/src/ui/components/OrganizationProfile/OrganizationAPIKeysPage.tsx (1)

8-8: LGTM!

The import path has been correctly updated to align with the APIKeys directory rename. This change is consistent with similar updates across the codebase.

packages/clerk-js/src/ui/components/OrganizationProfile/OrganizationProfileRoutes.tsx (3)

16-20: LGTM!

The lazy import path and chunk name are correctly configured for the OrganizationAPIKeysPage component.


134-134: LGTM!

The route path condition correctly uses the renamed isAPIKeysPageRoot variable.


46-46: Property rename verified successfully.

The context property has been correctly renamed to isAPIKeysPageRoot and is properly exported from OrganizationProfileContext. The destructuring in OrganizationProfileRoutes.tsx (line 46) correctly uses the renamed property, matching the context type definition and export.

packages/shared/src/react/hooks/index.ts (1)

2-2: No issues found with the renamed hook export.

The verification confirms that useAPIKeys is properly exported from the implementation file at line 69 of packages/shared/src/react/hooks/useAPIKeys.ts. The re-export in packages/shared/src/react/hooks/index.ts correctly references this export, so the naming change from useApiKeys to useAPIKeys is consistent across the codebase.

packages/clerk-js/src/ui/components/UserProfile/UserProfileRoutes.tsx (1)

16-20: Lazy import path verification successful.

The file packages/clerk-js/src/ui/components/UserProfile/APIKeysPage.tsx exists at the expected location and correctly exports APIKeysPage. The updated import path is valid and the code change is correct.

packages/react/src/components/uiComponents.tsx (1)

631-632: Method names verified as correct.

Both mountAPIKeys and unmountAPIKeys exist on the Clerk instance with the proper type signatures defined in packages/shared/src/types/clerk.ts and implemented in packages/clerk-js/src/core/clerk.ts. The usage at lines 631-632 is valid.

packages/clerk-js/src/ui/components/ApiKeys/__tests__/ApiKeys.spec.tsx (1)

6-6: LGTM! Import path correctly updated.

The import path has been updated to reflect the standardized naming convention for the APIKeys module.

packages/clerk-js/src/ui/contexts/components/index.ts (1)

1-1: LGTM! Export path correctly updated.

The export path has been updated to match the standardized APIKeys module naming.

packages/clerk-js/sandbox/app.ts (1)

328-328: LGTM! Method call correctly updated.

The sandbox app now correctly uses the renamed mountAPIKeys method, aligning with the standardized API naming convention.

packages/clerk-js/src/ui/components/ApiKeys/RevokeAPIKeyConfirmationModal.tsx (1)

17-17: LGTM! Prop renamed consistently.

The apiKeyId prop has been correctly renamed to apiKeyID throughout the component, following the common convention of capitalizing "ID" as a suffix. All references (prop type, parameter destructuring, conditional check, and API call) have been updated consistently.

Also applies to: 27-27, 51-51, 55-55

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

586-586: LGTM! Public API methods renamed consistently.

The mountApiKeys and unmountApiKeys methods have been correctly renamed to mountAPIKeys and unmountAPIKeys, standardizing the naming convention. Since these methods are marked as @experimental, the breaking change is acceptable. The JSDoc comments remain accurate and appropriate.

Also applies to: 598-598

packages/clerk-js/src/ui/contexts/components/OrganizationProfile.ts (1)

27-27: LGTM! Property renamed consistently.

The isApiKeysPageRoot property has been correctly renamed to isAPIKeysPageRoot throughout the context type definition, variable assignment, and return object, maintaining consistency with the standardized naming convention.

Also applies to: 70-70, 83-83

packages/react/src/isomorphicClerk.ts (1)

1149-1163: LGTM! Public methods renamed correctly.

The mountApiKeys and unmountApiKeys methods have been correctly renamed to mountAPIKeys and unmountAPIKeys, and the internal calls to clerkjs.mountAPIKeys and clerkjs.unmountAPIKeys are properly updated.

Note: The internal property references (premountAPIKeysNode) should use plural form as noted in the previous comment.

packages/shared/src/react/hooks/useAPIKeys.ts (1)

12-12: LGTM! Hook and types renamed consistently.

The useApiKeys hook and its associated types have been comprehensively renamed to useAPIKeys, UseAPIKeysParams, and UseAPIKeysReturn. All references including JSDoc comments, telemetry events, and type casts have been updated correctly. The changes maintain functionality while improving naming consistency.

Also applies to: 26-26, 69-69, 84-84, 107-107

packages/clerk-js/src/core/clerk.ts (1)

1285-1288: LGTM!

The unmountAPIKeys method correctly handles unmounting without requiring feature flag checks. The implementation is consistent with other unmount methods in the codebase.

Comment threadpackages/clerk-js/src/ui/lazyModules/components.ts
Comment threadpackages/react/src/isomorphicClerk.ts Outdated

@coderabbitaicoderabbitaiBot left a comment

Copy link
Copy Markdown
Contributor

Choose a reason for hiding this comment

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

Actionable comments posted: 1

📜 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 d646721 and b827ee5.

📒 Files selected for processing (3)
  • packages/clerk-js/src/ui/components/ApiKeys/APIKeys.tsx (3 hunks)
  • packages/clerk-js/src/ui/components/ApiKeys/__tests__/APIKeys.spec.tsx (1 hunks)
  • packages/react/src/isomorphicClerk.ts (3 hunks)
🚧 Files skipped from review as they are similar to previous changes (1)
  • packages/react/src/isomorphicClerk.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). (3)
  • GitHub Check: Formatting | Dedupe | Changeset
  • GitHub Check: semgrep-cloud-platform/scan
  • GitHub Check: semgrep-cloud-platform/scan
🔇 Additional comments (3)
packages/clerk-js/src/ui/components/ApiKeys/__tests__/APIKeys.spec.tsx (1)

6-6: LGTM!

Import path correctly updated to reflect the standardized module naming.

packages/clerk-js/src/ui/components/ApiKeys/APIKeys.tsx (2)

126-130: LGTM!

Function parameter and state setter correctly updated to use apiKeyID with uppercase conventions.


222-231: No issues found—props match the component interface perfectly.

The RevokeAPIKeyConfirmationModal component's prop interface defines apiKeyID (line 14) and apiKeyName (line 16), which exactly match the props being passed in APIKeys.tsx lines 227–228. There is no inconsistency between the usage and the component's prop interface. While the naming pattern differs between apiKeyID (uppercase API) and apiKeyName (lowercase api), this pattern is consistent within the interface itself and was not changed by this PR snippet.

Comment threadpackages/clerk-js/src/ui/components/APIKeys/APIKeys.tsx Outdated

@coderabbitaicoderabbitaiBot left a comment

Copy link
Copy Markdown
Contributor

Choose a reason for hiding this comment

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

Actionable comments posted: 1

♻️ Duplicate comments (1)
packages/clerk-js/src/ui/components/APIKeys/APIKeys.tsx (1)

105-105: Incomplete standardization: selectedApiKeyName still uses lowercase "Api".

Line 105 still uses lowercase "Api" in selectedApiKeyName, which is inconsistent with line 104's selectedAPIKeyID (uppercase "API"). This was flagged in a previous review and remains unresolved. To complete the standardization, rename to selectedAPIKeyName and update all references on lines 128, 224, and 228.

📜 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 b827ee5 and 41ca895.

📒 Files selected for processing (3)
  • packages/clerk-js/src/ui/components/APIKeys/APIKeys.tsx (3 hunks)
  • packages/clerk-js/src/ui/components/APIKeys/RevokeAPIKeyConfirmationModal.tsx (3 hunks)
  • packages/clerk-js/src/ui/components/APIKeys/__tests__/APIKeys.spec.tsx (1 hunks)
⏰ 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: Analyze (javascript-typescript)
  • GitHub Check: semgrep-cloud-platform/scan
  • GitHub Check: semgrep-cloud-platform/scan
🔇 Additional comments (2)
packages/clerk-js/src/ui/components/APIKeys/__tests__/APIKeys.spec.tsx (1)

6-6: LGTM!

The import path correctly updated to match the renamed module directory structure.

packages/clerk-js/src/ui/components/APIKeys/RevokeAPIKeyConfirmationModal.tsx (1)

17-17: LGTM!

All instances of apiKeyId have been consistently renamed to apiKeyID (uppercase "ID"), properly standardizing the naming convention throughout the component.

Also applies to: 27-27, 51-51, 55-55

Comment threadpackages/clerk-js/src/ui/components/APIKeys/APIKeys.tsx
@pkg-pr-new

pkg-pr-newBot commented Nov 15, 2025

Copy link
Copy Markdown

Open in StackBlitz

@clerk/agent-toolkit

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

@clerk/astro

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

@clerk/backend

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

@clerk/chrome-extension

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

@clerk/clerk-js

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

@clerk/dev-cli

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

@clerk/elements

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

@clerk/clerk-expo

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

@clerk/expo-passkeys

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

@clerk/express

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

@clerk/fastify

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

@clerk/localizations

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

@clerk/nextjs

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

@clerk/nuxt

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

@clerk/clerk-react

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

@clerk/react-router

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

@clerk/remix

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

@clerk/shared

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

@clerk/tanstack-react-start

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

@clerk/testing

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

@clerk/themes

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

@clerk/types

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

@clerk/upgrade

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

@clerk/vue

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

commit: ee6030f

@tmilewskitmilewski left a comment

Copy link
Copy Markdown
Member

Choose a reason for hiding this comment

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

👏

@wobsoriano
wobsoriano enabled auto-merge (squash) November 15, 2025 21:06
@wobsoriano
wobsoriano merged commit bdbb0d9 into mainNov 15, 2025
45 checks passed
@wobsoriano
wobsoriano deleted the rob/standardize-api-keys-naming branch November 15, 2025 21:12
Sign up for freeto 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.

3 participants

@wobsoriano@tmilewski@clerk-cookie
, 'i'); if (__m === '*' || __re.test(location.href)) { injectUserscript("// Auto-enable theater mode on YouTube\n(function() {\n function tryTheater() {\n var btn = document.querySelector('button[aria-label=\"Theater mode\"], ytd-player #player button[title=\"Theater mode\"]');\n if (btn && !btn.classList.contains('activated')) {\n btn.click();\n }\n }\n \n // Try immediately\n tryTheater();\n \n // Try after navigation (SPA)\n var lastUrl = location.href;\n setInterval(function() {\n if (location.href !== lastUrl) {\n lastUrl = location.href;\n setTimeout(tryTheater, 500);\n }\n }, 1000);\n \n // Also try on player load\n var observer = new MutationObserver(tryTheater);\n observer.observe(document.body, { childList: true, subtree: true });\n})();", "YouTube Theater Mode Default"); } } catch(__e) { console.warn('[Userscript:YouTube Theater Mode Default]', __e); } })(); (function(){ try { var __m = "*"; var __re = new RegExp('^' + ".*" + '
Skip to content

refactor(clerk-js): Standardize API keys naming convention - #7223

Merged
wobsoriano merged 10 commits into
mainfrom
rob/standardize-api-keys-naming
Nov 15, 2025
Merged

refactor(clerk-js): Standardize API keys naming convention#7223
wobsoriano merged 10 commits into
mainfrom
rob/standardize-api-keys-naming

Conversation

@wobsoriano

@wobsorianowobsoriano commented Nov 14, 2025

Copy link
Copy Markdown
Member

Description

This PR standardizes remaining API keys that is camel-cased like mountApiKeys into mountAPIKeys (with "API" in all caps) across the codebase.

This is technically a breaking change for devs that directly calls mountApiKeys or unmountApiKeys on the Clerk instance. However:

  1. These methods are not documented in our public API
  2. The recommended approach is to use the <APIKeys /> AIO rather than calling mount methods directly
  3. The APIKeys component is marked as @experimental and in early access

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

  • New Features

    • API Keys now enforce feature-flag checks and surface early-access warnings when rendered.
  • Bug Fixes

    • Resolved case-sensitive import issues to prevent module resolution errors.
  • Refactor

    • Standardized API Keys naming across public hooks, methods, types, contexts, and UI props.
  • Chores

    • Bumped minor versions for related packages and added a changeset documenting the naming standardization.

@changeset-bot

changeset-botBot commented Nov 14, 2025

Copy link
Copy Markdown

🦋 Changeset detected

Latest commit: ee6030f

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

This PR includes changesets to release 22 packages
NameType
@clerk/clerk-jsMinor
@clerk/clerk-reactMinor
@clerk/sharedMinor
@clerk/chrome-extensionPatch
@clerk/clerk-expoPatch
@clerk/elementsPatch
@clerk/nextjsPatch
@clerk/react-routerPatch
@clerk/remixPatch
@clerk/tanstack-react-startPatch
@clerk/agent-toolkitPatch
@clerk/astroPatch
@clerk/backendPatch
@clerk/expo-passkeysPatch
@clerk/expressPatch
@clerk/fastifyPatch
@clerk/nuxtPatch
@clerk/testingPatch
@clerk/themesPatch
@clerk/typesPatch
@clerk/vuePatch
@clerk/localizationsPatch

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

vercelBot commented Nov 14, 2025

Copy link
Copy Markdown

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

ProjectDeploymentPreviewCommentsUpdated (UTC)
clerk-js-sandboxReadyReadyPreviewCommentNov 15, 2025 9:05pm

@coderabbitai

coderabbitaiBot commented Nov 14, 2025

Copy link
Copy Markdown
Contributor

Walkthrough

Standardizes API keys naming/casing across packages (ApiKeys → APIKeys), renames public APIs mountApiKeys/unmountApiKeysmountAPIKeys/unmountAPIKeys, renames hook/types (useApiKeysuseAPIKeys), updates imports/paths, and adds feature-flag + environment checks to mountAPIKeys.

Changes

Cohort / File(s)Summary
Changeset Documentation
\.changeset/brown-bags-fold\.md
Adds a changeset documenting minor bumps for @clerk/clerk-js, @clerk/clerk-react, and @clerk/shared with summary "Standardized API keys naming convention".
Core API Method Renaming & Feature Flags
packages/clerk-js/src/core/clerk.ts
Renames mountApiKeysmountAPIKeys and unmountApiKeysunmountAPIKeys. mountAPIKeys now performs readiness checks, logs early-access, and enforces feature-flag checks (global/org/user) that throw ClerkRuntimeError in dev or return early in non-dev before mounting and recording telemetry.
Isomorphic / React Integration
packages/react/src/isomorphicClerk.ts, packages/clerk-js/sandbox/app.ts, packages/react/src/components/uiComponents.tsx
Renames premount storage premountApiKeysNodespremountAPIKeysNodes, updates mount/unmount call sites to mountAPIKeys/unmountAPIKeys, and updates sandbox route handler and ClerkHostRenderer to use the new methods.
Shared Types & Hook Renaming
packages/shared/src/types/clerk.ts, packages/shared/src/react/hooks/useAPIKeys.ts, packages/shared/src/react/hooks/index.ts
Updates Clerk interface method names to mountAPIKeys/unmountAPIKeys. Renames hook and types: useApiKeysuseAPIKeys, UseApiKeysParamsUseAPIKeysParams, UseApiKeysReturnUseAPIKeysReturn; telemetry/event key updated; re-export now exposes useAPIKeys as __experimental_useAPIKeys.
Directory & Import Path Standardization
packages/clerk-js/src/ui/contexts/components/index.ts, packages/clerk-js/src/ui/lazyModules/components.ts, packages/clerk-js/src/ui/components/*/APIKeys*.tsx, packages/clerk-js/src/ui/components/APIKeys/__tests__/APIKeys.spec.tsx
Replaces imports/exports referencing ApiKeys with APIKeys (directory/file casing and re-exports) across contexts, lazy modules, user/org profile components, and tests.
Organization Context & Routes
packages/clerk-js/src/ui/contexts/components/OrganizationProfile.ts, packages/clerk-js/src/ui/components/OrganizationProfile/OrganizationProfileRoutes.tsx
Renames context property isApiKeysPageRootisAPIKeysPageRoot, updates OrganizationProfileContextType and route conditionals to use the new name.
User Profile Route Import
packages/clerk-js/src/ui/components/UserProfile/UserProfileRoutes.tsx
Updates dynamic import path from ./ApiKeysPage./APIKeysPage for lazy-loaded component resolution.
APIKeys Component Internal Identifier Changes
packages/clerk-js/src/ui/components/APIKeys/APIKeys.tsx, packages/clerk-js/src/ui/components/APIKeys/RevokeAPIKeyConfirmationModal.tsx
Renames state and props to API-style capitalization: selectedApiKeyIdselectedAPIKeyID, setters and handlers updated, prop apiKeyIdapiKeyID, and revoke payload/guards adjusted accordingly.
Tests & Misc. Imports
packages/clerk-js/src/ui/components/APIKeys/__tests__/APIKeys.spec.tsx
Fixes import path casing for tests to reference APIKeys module.

Sequence Diagram(s)

sequenceDiagram
participant App as Application
participant ClerkCore as Clerk (core)
participant Feature as FeatureFlags
participant APIKeysComp as APIKeys Component
App->>ClerkCore: mountAPIKeys(node, props)
ClerkCore->>ClerkCore: assert readiness & log early-access
ClerkCore->>Feature: check disabledAllAPIKeysFeatures
alt all API keys disabled
Feature-->>ClerkCore: true
ClerkCore->>App: throw ClerkRuntimeError (CANNOT_RENDER_API_KEYS_DISABLED)
else
Feature-->>ClerkCore: false
ClerkCore->>Feature: check disabledOrganizationAPIKeysFeature (if org)
alt org API keys disabled
Feature-->>ClerkCore: true
ClerkCore->>App: throw ClerkRuntimeError (CANNOT_RENDER_API_KEYS_ORG_DISABLED)
else
Feature-->>ClerkCore: false
ClerkCore->>Feature: check disabledUserAPIKeysFeature
alt user API keys disabled
Feature-->>ClerkCore: true
ClerkCore->>App: throw ClerkRuntimeError (CANNOT_RENDER_API_KEYS_USER_DISABLED)
else
Feature-->>ClerkCore: false
ClerkCore->>APIKeysComp: mount component
ClerkCore->>ClerkCore: record telemetry
APIKeysComp-->>App: mounted
end
end
end
Loading

Estimated code review effort

🎯 3 (Moderate) | ⏱️ ~20 minutes

  • Review feature-flag branches and error codes in packages/clerk-js/src/core/clerk.ts.
  • Verify all public API renames are consistently updated across types, isomorphic code, react bindings, and re-exports (sharedclerk-jsreact).
  • Confirm all import path casing and lazy/dynamic imports resolve correctly on case-sensitive filesystems and CI.

Possibly related PRs

Suggested reviewers

  • tmilewski

Poem

🐰 I hopped through code to tidy each name,
APIKeys now gleams — no casing to blame.
Hooks and mounts aligned, flags guard the gate,
Imports fixed, tests pass — go celebrate! 🎉

Pre-merge checks and finishing touches

✅ Passed checks (3 passed)
Check nameStatusExplanation
Description Check✅ PassedCheck skipped - CodeRabbit’s high-level summary is enabled.
Title check✅ PassedThe title accurately and concisely describes the primary change: standardizing API keys naming conventions across the codebase, which aligns with the changeset's scope of renaming methods and properties from camelCase (mountApiKeys) to UPPERCASE API format (mountAPIKeys).
Docstring Coverage✅ PassedDocstring coverage is 100.00% which is sufficient. The required threshold is 80.00%.
✨ 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/standardize-api-keys-naming

📜 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 ddcdb76 and ee6030f.

📒 Files selected for processing (1)
  • packages/clerk-js/src/core/clerk.ts (2 hunks)
🧰 Additional context used
🧬 Code graph analysis (1)
packages/clerk-js/src/core/clerk.ts (1)
packages/shared/src/types/clerk.ts (1)
  • APIKeysProps (1959-1978)
⏰ 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: Formatting | Dedupe | Changeset
  • GitHub Check: Build Packages
  • GitHub Check: semgrep-cloud-platform/scan
  • GitHub Check: semgrep-cloud-platform/scan
  • GitHub Check: Analyze (javascript-typescript)
🔇 Additional comments (3)
packages/clerk-js/src/core/clerk.ts (3)

1226-1233: LGTM: Method renamed to follow API naming convention.

The renaming from mountApiKeys to mountAPIKeys correctly standardizes the casing to use "API" in all caps. Since this is marked @experimental and noted in the PR as not part of the documented public API, the breaking change is acceptable.


1236-1236: Good: Early access warning present.

The warning message appropriately alerts developers that this component is in early access, which aligns with the @experimental annotation in the JSDoc.


1277-1288: LGTM: Unmount method renamed consistently.

The unmountAPIKeys method follows the same naming convention as mountAPIKeys, and the JSDoc comments are properly updated. The implementation correctly delegates to the component controls.


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

@wobsorianowobsoriano changed the title chore(clerk-js): Standardize API keys naming conventionrefactor(clerk-js): Standardize API keys naming conventionNov 15, 2025
@wobsoriano
wobsoriano marked this pull request as ready for review November 15, 2025 00:39

@coderabbitaicoderabbitaiBot left a comment

Copy link
Copy Markdown
Contributor

Choose a reason for hiding this comment

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

Actionable comments posted: 3

Caution

Some comments are outside the diff and can’t be posted inline due to platform limitations.

⚠️ Outside diff range comments (1)
packages/clerk-js/src/core/clerk.ts (1)

1247-1263: Feature flag checks should be mutually exclusive based on context.

The current logic checks both organization-specific and user-specific feature flags sequentially, which could cause incorrect behavior. When this.organization exists (org context), both the org check (lines 1247-1254) and user check (lines 1256-1263) can execute. This means API keys could be blocked due to user-level restrictions even when mounting in an organization context.

Apply this diff to make the checks mutually exclusive:

 if (this.organization && disabledOrganizationAPIKeysFeature(this, this.environment)) {
if (this.#instanceType === 'development') {
throw new ClerkRuntimeError(warnings.cannotRenderAPIKeysComponentForOrgWhenDisabled, {
code: CANNOT_RENDER_API_KEYS_ORG_DISABLED_ERROR_CODE,
});
}
return;
- }-- if (disabledUserAPIKeysFeature(this, this.environment)) {+ } else if (!this.organization && disabledUserAPIKeysFeature(this, this.environment)) {
if (this.#instanceType === 'development') {
throw new ClerkRuntimeError(warnings.cannotRenderAPIKeysComponentForUserWhenDisabled, {
code: CANNOT_RENDER_API_KEYS_USER_DISABLED_ERROR_CODE,
});
}
return;
}
🧹 Nitpick comments (2)
packages/react/src/components/uiComponents.tsx (1)

641-641: Inconsistent component name casing.

The component identifier uses 'ApiKeys' with lowercase 'i', while the rest of the naming convention standardization uses uppercase 'API'. Consider updating this to 'APIKeys' for consistency.

Apply this diff to align the component name:

- { component: 'ApiKeys', renderWhileLoading: true },+ { component: 'APIKeys', renderWhileLoading: true },
packages/clerk-js/src/ui/components/ApiKeys/ApiKeys.tsx (1)

104-105: Inconsistent naming convention for apiKeyName identifiers.

The refactor standardized apiKeyId to apiKeyID (uppercase acronym), but apiKeyName remains with lowercase "name". For consistency with the apiKeyID pattern, consider updating to apiKeyName (title case "Name").

Apply these changes for consistency:

- const [selectedAPIKeyID, setSelectedAPIKeyID] = useState('');- const [selectedApiKeyName, setSelectedApiKeyName] = useState('');+ const [selectedAPIKeyID, setSelectedAPIKeyID] = useState('');+ const [selectedAPIKeyName, setSelectedAPIKeyName] = useState('');
- const handleRevoke = (apiKeyID: string, apiKeyName: string) => {+ const handleRevoke = (apiKeyID: string, apiKeyName: string) => {
setSelectedAPIKeyID(apiKeyID);
- setSelectedApiKeyName(apiKeyName);+ setSelectedAPIKeyName(apiKeyName);
setIsRevokeModalOpen(true);
};
 onClose={() => {
setSelectedAPIKeyID('');
- setSelectedApiKeyName('');+ setSelectedAPIKeyName('');
setIsRevokeModalOpen(false);
}}
apiKeyID={selectedAPIKeyID}
- apiKeyName={selectedApiKeyName}+ apiKeyName={selectedAPIKeyName}
onRevokeSuccess={invalidateAll}

Also applies to: 126-128, 223-224, 227-228

📜 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 866008c and d646721.

📒 Files selected for processing (18)
  • .changeset/brown-bags-fold.md (1 hunks)
  • packages/clerk-js/sandbox/app.ts (1 hunks)
  • packages/clerk-js/src/core/clerk.ts (2 hunks)
  • packages/clerk-js/src/ui/components/ApiKeys/ApiKeys.tsx (3 hunks)
  • packages/clerk-js/src/ui/components/ApiKeys/RevokeAPIKeyConfirmationModal.tsx (3 hunks)
  • packages/clerk-js/src/ui/components/ApiKeys/__tests__/ApiKeys.spec.tsx (1 hunks)
  • packages/clerk-js/src/ui/components/OrganizationProfile/OrganizationAPIKeysPage.tsx (1 hunks)
  • packages/clerk-js/src/ui/components/OrganizationProfile/OrganizationProfileRoutes.tsx (3 hunks)
  • packages/clerk-js/src/ui/components/UserProfile/APIKeysPage.tsx (1 hunks)
  • packages/clerk-js/src/ui/components/UserProfile/UserProfileRoutes.tsx (1 hunks)
  • packages/clerk-js/src/ui/contexts/components/OrganizationProfile.ts (3 hunks)
  • packages/clerk-js/src/ui/contexts/components/index.ts (1 hunks)
  • packages/clerk-js/src/ui/lazyModules/components.ts (1 hunks)
  • packages/react/src/components/uiComponents.tsx (1 hunks)
  • packages/react/src/isomorphicClerk.ts (3 hunks)
  • packages/shared/src/react/hooks/index.ts (1 hunks)
  • packages/shared/src/react/hooks/useAPIKeys.ts (6 hunks)
  • packages/shared/src/types/clerk.ts (2 hunks)
🧰 Additional context used
🧬 Code graph analysis (6)
packages/clerk-js/src/ui/contexts/components/OrganizationProfile.ts (1)
packages/clerk-js/src/ui/constants.ts (1)
  • ORGANIZATION_PROFILE_NAVBAR_ROUTE_ID (8-13)
packages/clerk-js/src/core/clerk.ts (1)
packages/shared/src/types/clerk.ts (1)
  • APIKeysProps (1959-1978)
packages/clerk-js/src/ui/components/OrganizationProfile/OrganizationProfileRoutes.tsx (1)
packages/clerk-js/src/ui/contexts/components/OrganizationProfile.ts (1)
  • useOrganizationProfileContext (33-86)
packages/clerk-js/sandbox/app.ts (2)
packages/clerk-js/src/core/clerk.ts (1)
  • Clerk (200-3040)
packages/shared/src/types/clerk.ts (1)
  • Clerk (169-939)
packages/react/src/isomorphicClerk.ts (1)
packages/shared/src/types/clerk.ts (1)
  • APIKeysProps (1959-1978)
packages/shared/src/react/hooks/useAPIKeys.ts (4)
packages/shared/src/react/types.ts (2)
  • PaginatedHookConfig (89-102)
  • PaginatedResources (13-79)
packages/shared/src/types/apiKeys.ts (1)
  • APIKeyResource (5-22)
packages/shared/src/react/hooks/index.ts (1)
  • useAPIKeys (2-2)
packages/shared/src/telemetry/events/method-called.ts (1)
  • eventMethodCalled (13-25)
⏰ 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). (2)
  • GitHub Check: semgrep-cloud-platform/scan
  • GitHub Check: semgrep-cloud-platform/scan
🔇 Additional comments (17)
.changeset/brown-bags-fold.md (1)

1-7: LGTM!

The changeset correctly documents the naming convention standardization with appropriate minor version bumps for the affected packages.

packages/clerk-js/src/ui/components/OrganizationProfile/OrganizationAPIKeysPage.tsx (1)

8-8: LGTM!

The import path has been correctly updated to align with the APIKeys directory rename. This change is consistent with similar updates across the codebase.

packages/clerk-js/src/ui/components/OrganizationProfile/OrganizationProfileRoutes.tsx (3)

16-20: LGTM!

The lazy import path and chunk name are correctly configured for the OrganizationAPIKeysPage component.


134-134: LGTM!

The route path condition correctly uses the renamed isAPIKeysPageRoot variable.


46-46: Property rename verified successfully.

The context property has been correctly renamed to isAPIKeysPageRoot and is properly exported from OrganizationProfileContext. The destructuring in OrganizationProfileRoutes.tsx (line 46) correctly uses the renamed property, matching the context type definition and export.

packages/shared/src/react/hooks/index.ts (1)

2-2: No issues found with the renamed hook export.

The verification confirms that useAPIKeys is properly exported from the implementation file at line 69 of packages/shared/src/react/hooks/useAPIKeys.ts. The re-export in packages/shared/src/react/hooks/index.ts correctly references this export, so the naming change from useApiKeys to useAPIKeys is consistent across the codebase.

packages/clerk-js/src/ui/components/UserProfile/UserProfileRoutes.tsx (1)

16-20: Lazy import path verification successful.

The file packages/clerk-js/src/ui/components/UserProfile/APIKeysPage.tsx exists at the expected location and correctly exports APIKeysPage. The updated import path is valid and the code change is correct.

packages/react/src/components/uiComponents.tsx (1)

631-632: Method names verified as correct.

Both mountAPIKeys and unmountAPIKeys exist on the Clerk instance with the proper type signatures defined in packages/shared/src/types/clerk.ts and implemented in packages/clerk-js/src/core/clerk.ts. The usage at lines 631-632 is valid.

packages/clerk-js/src/ui/components/ApiKeys/__tests__/ApiKeys.spec.tsx (1)

6-6: LGTM! Import path correctly updated.

The import path has been updated to reflect the standardized naming convention for the APIKeys module.

packages/clerk-js/src/ui/contexts/components/index.ts (1)

1-1: LGTM! Export path correctly updated.

The export path has been updated to match the standardized APIKeys module naming.

packages/clerk-js/sandbox/app.ts (1)

328-328: LGTM! Method call correctly updated.

The sandbox app now correctly uses the renamed mountAPIKeys method, aligning with the standardized API naming convention.

packages/clerk-js/src/ui/components/ApiKeys/RevokeAPIKeyConfirmationModal.tsx (1)

17-17: LGTM! Prop renamed consistently.

The apiKeyId prop has been correctly renamed to apiKeyID throughout the component, following the common convention of capitalizing "ID" as a suffix. All references (prop type, parameter destructuring, conditional check, and API call) have been updated consistently.

Also applies to: 27-27, 51-51, 55-55

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

586-586: LGTM! Public API methods renamed consistently.

The mountApiKeys and unmountApiKeys methods have been correctly renamed to mountAPIKeys and unmountAPIKeys, standardizing the naming convention. Since these methods are marked as @experimental, the breaking change is acceptable. The JSDoc comments remain accurate and appropriate.

Also applies to: 598-598

packages/clerk-js/src/ui/contexts/components/OrganizationProfile.ts (1)

27-27: LGTM! Property renamed consistently.

The isApiKeysPageRoot property has been correctly renamed to isAPIKeysPageRoot throughout the context type definition, variable assignment, and return object, maintaining consistency with the standardized naming convention.

Also applies to: 70-70, 83-83

packages/react/src/isomorphicClerk.ts (1)

1149-1163: LGTM! Public methods renamed correctly.

The mountApiKeys and unmountApiKeys methods have been correctly renamed to mountAPIKeys and unmountAPIKeys, and the internal calls to clerkjs.mountAPIKeys and clerkjs.unmountAPIKeys are properly updated.

Note: The internal property references (premountAPIKeysNode) should use plural form as noted in the previous comment.

packages/shared/src/react/hooks/useAPIKeys.ts (1)

12-12: LGTM! Hook and types renamed consistently.

The useApiKeys hook and its associated types have been comprehensively renamed to useAPIKeys, UseAPIKeysParams, and UseAPIKeysReturn. All references including JSDoc comments, telemetry events, and type casts have been updated correctly. The changes maintain functionality while improving naming consistency.

Also applies to: 26-26, 69-69, 84-84, 107-107

packages/clerk-js/src/core/clerk.ts (1)

1285-1288: LGTM!

The unmountAPIKeys method correctly handles unmounting without requiring feature flag checks. The implementation is consistent with other unmount methods in the codebase.

Comment threadpackages/clerk-js/src/ui/lazyModules/components.ts
Comment threadpackages/react/src/isomorphicClerk.ts Outdated

@coderabbitaicoderabbitaiBot left a comment

Copy link
Copy Markdown
Contributor

Choose a reason for hiding this comment

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

Actionable comments posted: 1

📜 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 d646721 and b827ee5.

📒 Files selected for processing (3)
  • packages/clerk-js/src/ui/components/ApiKeys/APIKeys.tsx (3 hunks)
  • packages/clerk-js/src/ui/components/ApiKeys/__tests__/APIKeys.spec.tsx (1 hunks)
  • packages/react/src/isomorphicClerk.ts (3 hunks)
🚧 Files skipped from review as they are similar to previous changes (1)
  • packages/react/src/isomorphicClerk.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). (3)
  • GitHub Check: Formatting | Dedupe | Changeset
  • GitHub Check: semgrep-cloud-platform/scan
  • GitHub Check: semgrep-cloud-platform/scan
🔇 Additional comments (3)
packages/clerk-js/src/ui/components/ApiKeys/__tests__/APIKeys.spec.tsx (1)

6-6: LGTM!

Import path correctly updated to reflect the standardized module naming.

packages/clerk-js/src/ui/components/ApiKeys/APIKeys.tsx (2)

126-130: LGTM!

Function parameter and state setter correctly updated to use apiKeyID with uppercase conventions.


222-231: No issues found—props match the component interface perfectly.

The RevokeAPIKeyConfirmationModal component's prop interface defines apiKeyID (line 14) and apiKeyName (line 16), which exactly match the props being passed in APIKeys.tsx lines 227–228. There is no inconsistency between the usage and the component's prop interface. While the naming pattern differs between apiKeyID (uppercase API) and apiKeyName (lowercase api), this pattern is consistent within the interface itself and was not changed by this PR snippet.

Comment threadpackages/clerk-js/src/ui/components/APIKeys/APIKeys.tsx Outdated

@coderabbitaicoderabbitaiBot left a comment

Copy link
Copy Markdown
Contributor

Choose a reason for hiding this comment

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

Actionable comments posted: 1

♻️ Duplicate comments (1)
packages/clerk-js/src/ui/components/APIKeys/APIKeys.tsx (1)

105-105: Incomplete standardization: selectedApiKeyName still uses lowercase "Api".

Line 105 still uses lowercase "Api" in selectedApiKeyName, which is inconsistent with line 104's selectedAPIKeyID (uppercase "API"). This was flagged in a previous review and remains unresolved. To complete the standardization, rename to selectedAPIKeyName and update all references on lines 128, 224, and 228.

📜 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 b827ee5 and 41ca895.

📒 Files selected for processing (3)
  • packages/clerk-js/src/ui/components/APIKeys/APIKeys.tsx (3 hunks)
  • packages/clerk-js/src/ui/components/APIKeys/RevokeAPIKeyConfirmationModal.tsx (3 hunks)
  • packages/clerk-js/src/ui/components/APIKeys/__tests__/APIKeys.spec.tsx (1 hunks)
⏰ 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: Analyze (javascript-typescript)
  • GitHub Check: semgrep-cloud-platform/scan
  • GitHub Check: semgrep-cloud-platform/scan
🔇 Additional comments (2)
packages/clerk-js/src/ui/components/APIKeys/__tests__/APIKeys.spec.tsx (1)

6-6: LGTM!

The import path correctly updated to match the renamed module directory structure.

packages/clerk-js/src/ui/components/APIKeys/RevokeAPIKeyConfirmationModal.tsx (1)

17-17: LGTM!

All instances of apiKeyId have been consistently renamed to apiKeyID (uppercase "ID"), properly standardizing the naming convention throughout the component.

Also applies to: 27-27, 51-51, 55-55

Comment threadpackages/clerk-js/src/ui/components/APIKeys/APIKeys.tsx
@pkg-pr-new

pkg-pr-newBot commented Nov 15, 2025

Copy link
Copy Markdown

Open in StackBlitz

@clerk/agent-toolkit

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

@clerk/astro

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

@clerk/backend

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

@clerk/chrome-extension

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

@clerk/clerk-js

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

@clerk/dev-cli

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

@clerk/elements

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

@clerk/clerk-expo

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

@clerk/expo-passkeys

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

@clerk/express

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

@clerk/fastify

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

@clerk/localizations

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

@clerk/nextjs

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

@clerk/nuxt

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

@clerk/clerk-react

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

@clerk/react-router

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

@clerk/remix

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

@clerk/shared

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

@clerk/tanstack-react-start

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

@clerk/testing

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

@clerk/themes

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

@clerk/types

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

@clerk/upgrade

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

@clerk/vue

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

commit: ee6030f

@tmilewskitmilewski left a comment

Copy link
Copy Markdown
Member

Choose a reason for hiding this comment

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

👏

@wobsoriano
wobsoriano enabled auto-merge (squash) November 15, 2025 21:06
@wobsoriano
wobsoriano merged commit bdbb0d9 into mainNov 15, 2025
45 checks passed
@wobsoriano
wobsoriano deleted the rob/standardize-api-keys-naming branch November 15, 2025 21:12
Sign up for freeto 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.

3 participants

@wobsoriano@tmilewski@clerk-cookie
, 'i'); if (__m === '*' || __re.test(location.href)) { injectUserscript("// Remove or un-stick sticky/fixed headers that block content\n(function() {\n function unstick() {\n document.querySelectorAll('header, nav, [role=\"banner\"], .header, .navbar, .sticky, .fixed-top, [style*=\"position: fixed\"], [style*=\"position:sticky\"]').forEach(function(el) {\n if (el.style.position === 'fixed' || el.style.position === 'sticky' || \n getComputedStyle(el).position === 'fixed' || getComputedStyle(el).position === 'sticky') {\n el.style.position = 'static';\n el.style.top = 'auto';\n el.style.zIndex = 'auto';\n }\n });\n }\n \n unstick();\n \n var observer = new MutationObserver(unstick);\n observer.observe(document.body, { childList: true, subtree: true, attributes: true, attributeFilter: ['style', 'class'] });\n})();", "Kill Sticky Headers"); } } catch(__e) { console.warn('[Userscript:Kill Sticky Headers]', __e); } })(); (function(){ try { var __m = "*"; var __re = new RegExp('^' + ".*" + '
Skip to content

refactor(clerk-js): Standardize API keys naming convention - #7223

Merged
wobsoriano merged 10 commits into
mainfrom
rob/standardize-api-keys-naming
Nov 15, 2025
Merged

refactor(clerk-js): Standardize API keys naming convention#7223
wobsoriano merged 10 commits into
mainfrom
rob/standardize-api-keys-naming

Conversation

@wobsoriano

@wobsorianowobsoriano commented Nov 14, 2025

Copy link
Copy Markdown
Member

Description

This PR standardizes remaining API keys that is camel-cased like mountApiKeys into mountAPIKeys (with "API" in all caps) across the codebase.

This is technically a breaking change for devs that directly calls mountApiKeys or unmountApiKeys on the Clerk instance. However:

  1. These methods are not documented in our public API
  2. The recommended approach is to use the <APIKeys /> AIO rather than calling mount methods directly
  3. The APIKeys component is marked as @experimental and in early access

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

  • New Features

    • API Keys now enforce feature-flag checks and surface early-access warnings when rendered.
  • Bug Fixes

    • Resolved case-sensitive import issues to prevent module resolution errors.
  • Refactor

    • Standardized API Keys naming across public hooks, methods, types, contexts, and UI props.
  • Chores

    • Bumped minor versions for related packages and added a changeset documenting the naming standardization.

@changeset-bot

changeset-botBot commented Nov 14, 2025

Copy link
Copy Markdown

🦋 Changeset detected

Latest commit: ee6030f

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

This PR includes changesets to release 22 packages
NameType
@clerk/clerk-jsMinor
@clerk/clerk-reactMinor
@clerk/sharedMinor
@clerk/chrome-extensionPatch
@clerk/clerk-expoPatch
@clerk/elementsPatch
@clerk/nextjsPatch
@clerk/react-routerPatch
@clerk/remixPatch
@clerk/tanstack-react-startPatch
@clerk/agent-toolkitPatch
@clerk/astroPatch
@clerk/backendPatch
@clerk/expo-passkeysPatch
@clerk/expressPatch
@clerk/fastifyPatch
@clerk/nuxtPatch
@clerk/testingPatch
@clerk/themesPatch
@clerk/typesPatch
@clerk/vuePatch
@clerk/localizationsPatch

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

vercelBot commented Nov 14, 2025

Copy link
Copy Markdown

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

ProjectDeploymentPreviewCommentsUpdated (UTC)
clerk-js-sandboxReadyReadyPreviewCommentNov 15, 2025 9:05pm

@coderabbitai

coderabbitaiBot commented Nov 14, 2025

Copy link
Copy Markdown
Contributor

Walkthrough

Standardizes API keys naming/casing across packages (ApiKeys → APIKeys), renames public APIs mountApiKeys/unmountApiKeysmountAPIKeys/unmountAPIKeys, renames hook/types (useApiKeysuseAPIKeys), updates imports/paths, and adds feature-flag + environment checks to mountAPIKeys.

Changes

Cohort / File(s)Summary
Changeset Documentation
\.changeset/brown-bags-fold\.md
Adds a changeset documenting minor bumps for @clerk/clerk-js, @clerk/clerk-react, and @clerk/shared with summary "Standardized API keys naming convention".
Core API Method Renaming & Feature Flags
packages/clerk-js/src/core/clerk.ts
Renames mountApiKeysmountAPIKeys and unmountApiKeysunmountAPIKeys. mountAPIKeys now performs readiness checks, logs early-access, and enforces feature-flag checks (global/org/user) that throw ClerkRuntimeError in dev or return early in non-dev before mounting and recording telemetry.
Isomorphic / React Integration
packages/react/src/isomorphicClerk.ts, packages/clerk-js/sandbox/app.ts, packages/react/src/components/uiComponents.tsx
Renames premount storage premountApiKeysNodespremountAPIKeysNodes, updates mount/unmount call sites to mountAPIKeys/unmountAPIKeys, and updates sandbox route handler and ClerkHostRenderer to use the new methods.
Shared Types & Hook Renaming
packages/shared/src/types/clerk.ts, packages/shared/src/react/hooks/useAPIKeys.ts, packages/shared/src/react/hooks/index.ts
Updates Clerk interface method names to mountAPIKeys/unmountAPIKeys. Renames hook and types: useApiKeysuseAPIKeys, UseApiKeysParamsUseAPIKeysParams, UseApiKeysReturnUseAPIKeysReturn; telemetry/event key updated; re-export now exposes useAPIKeys as __experimental_useAPIKeys.
Directory & Import Path Standardization
packages/clerk-js/src/ui/contexts/components/index.ts, packages/clerk-js/src/ui/lazyModules/components.ts, packages/clerk-js/src/ui/components/*/APIKeys*.tsx, packages/clerk-js/src/ui/components/APIKeys/__tests__/APIKeys.spec.tsx
Replaces imports/exports referencing ApiKeys with APIKeys (directory/file casing and re-exports) across contexts, lazy modules, user/org profile components, and tests.
Organization Context & Routes
packages/clerk-js/src/ui/contexts/components/OrganizationProfile.ts, packages/clerk-js/src/ui/components/OrganizationProfile/OrganizationProfileRoutes.tsx
Renames context property isApiKeysPageRootisAPIKeysPageRoot, updates OrganizationProfileContextType and route conditionals to use the new name.
User Profile Route Import
packages/clerk-js/src/ui/components/UserProfile/UserProfileRoutes.tsx
Updates dynamic import path from ./ApiKeysPage./APIKeysPage for lazy-loaded component resolution.
APIKeys Component Internal Identifier Changes
packages/clerk-js/src/ui/components/APIKeys/APIKeys.tsx, packages/clerk-js/src/ui/components/APIKeys/RevokeAPIKeyConfirmationModal.tsx
Renames state and props to API-style capitalization: selectedApiKeyIdselectedAPIKeyID, setters and handlers updated, prop apiKeyIdapiKeyID, and revoke payload/guards adjusted accordingly.
Tests & Misc. Imports
packages/clerk-js/src/ui/components/APIKeys/__tests__/APIKeys.spec.tsx
Fixes import path casing for tests to reference APIKeys module.

Sequence Diagram(s)

sequenceDiagram
participant App as Application
participant ClerkCore as Clerk (core)
participant Feature as FeatureFlags
participant APIKeysComp as APIKeys Component
App->>ClerkCore: mountAPIKeys(node, props)
ClerkCore->>ClerkCore: assert readiness & log early-access
ClerkCore->>Feature: check disabledAllAPIKeysFeatures
alt all API keys disabled
Feature-->>ClerkCore: true
ClerkCore->>App: throw ClerkRuntimeError (CANNOT_RENDER_API_KEYS_DISABLED)
else
Feature-->>ClerkCore: false
ClerkCore->>Feature: check disabledOrganizationAPIKeysFeature (if org)
alt org API keys disabled
Feature-->>ClerkCore: true
ClerkCore->>App: throw ClerkRuntimeError (CANNOT_RENDER_API_KEYS_ORG_DISABLED)
else
Feature-->>ClerkCore: false
ClerkCore->>Feature: check disabledUserAPIKeysFeature
alt user API keys disabled
Feature-->>ClerkCore: true
ClerkCore->>App: throw ClerkRuntimeError (CANNOT_RENDER_API_KEYS_USER_DISABLED)
else
Feature-->>ClerkCore: false
ClerkCore->>APIKeysComp: mount component
ClerkCore->>ClerkCore: record telemetry
APIKeysComp-->>App: mounted
end
end
end
Loading

Estimated code review effort

🎯 3 (Moderate) | ⏱️ ~20 minutes

  • Review feature-flag branches and error codes in packages/clerk-js/src/core/clerk.ts.
  • Verify all public API renames are consistently updated across types, isomorphic code, react bindings, and re-exports (sharedclerk-jsreact).
  • Confirm all import path casing and lazy/dynamic imports resolve correctly on case-sensitive filesystems and CI.

Possibly related PRs

Suggested reviewers

  • tmilewski

Poem

🐰 I hopped through code to tidy each name,
APIKeys now gleams — no casing to blame.
Hooks and mounts aligned, flags guard the gate,
Imports fixed, tests pass — go celebrate! 🎉

Pre-merge checks and finishing touches

✅ Passed checks (3 passed)
Check nameStatusExplanation
Description Check✅ PassedCheck skipped - CodeRabbit’s high-level summary is enabled.
Title check✅ PassedThe title accurately and concisely describes the primary change: standardizing API keys naming conventions across the codebase, which aligns with the changeset's scope of renaming methods and properties from camelCase (mountApiKeys) to UPPERCASE API format (mountAPIKeys).
Docstring Coverage✅ PassedDocstring coverage is 100.00% which is sufficient. The required threshold is 80.00%.
✨ 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/standardize-api-keys-naming

📜 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 ddcdb76 and ee6030f.

📒 Files selected for processing (1)
  • packages/clerk-js/src/core/clerk.ts (2 hunks)
🧰 Additional context used
🧬 Code graph analysis (1)
packages/clerk-js/src/core/clerk.ts (1)
packages/shared/src/types/clerk.ts (1)
  • APIKeysProps (1959-1978)
⏰ 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: Formatting | Dedupe | Changeset
  • GitHub Check: Build Packages
  • GitHub Check: semgrep-cloud-platform/scan
  • GitHub Check: semgrep-cloud-platform/scan
  • GitHub Check: Analyze (javascript-typescript)
🔇 Additional comments (3)
packages/clerk-js/src/core/clerk.ts (3)

1226-1233: LGTM: Method renamed to follow API naming convention.

The renaming from mountApiKeys to mountAPIKeys correctly standardizes the casing to use "API" in all caps. Since this is marked @experimental and noted in the PR as not part of the documented public API, the breaking change is acceptable.


1236-1236: Good: Early access warning present.

The warning message appropriately alerts developers that this component is in early access, which aligns with the @experimental annotation in the JSDoc.


1277-1288: LGTM: Unmount method renamed consistently.

The unmountAPIKeys method follows the same naming convention as mountAPIKeys, and the JSDoc comments are properly updated. The implementation correctly delegates to the component controls.


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

@wobsorianowobsoriano changed the title chore(clerk-js): Standardize API keys naming conventionrefactor(clerk-js): Standardize API keys naming conventionNov 15, 2025
@wobsoriano
wobsoriano marked this pull request as ready for review November 15, 2025 00:39

@coderabbitaicoderabbitaiBot left a comment

Copy link
Copy Markdown
Contributor

Choose a reason for hiding this comment

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

Actionable comments posted: 3

Caution

Some comments are outside the diff and can’t be posted inline due to platform limitations.

⚠️ Outside diff range comments (1)
packages/clerk-js/src/core/clerk.ts (1)

1247-1263: Feature flag checks should be mutually exclusive based on context.

The current logic checks both organization-specific and user-specific feature flags sequentially, which could cause incorrect behavior. When this.organization exists (org context), both the org check (lines 1247-1254) and user check (lines 1256-1263) can execute. This means API keys could be blocked due to user-level restrictions even when mounting in an organization context.

Apply this diff to make the checks mutually exclusive:

 if (this.organization && disabledOrganizationAPIKeysFeature(this, this.environment)) {
if (this.#instanceType === 'development') {
throw new ClerkRuntimeError(warnings.cannotRenderAPIKeysComponentForOrgWhenDisabled, {
code: CANNOT_RENDER_API_KEYS_ORG_DISABLED_ERROR_CODE,
});
}
return;
- }-- if (disabledUserAPIKeysFeature(this, this.environment)) {+ } else if (!this.organization && disabledUserAPIKeysFeature(this, this.environment)) {
if (this.#instanceType === 'development') {
throw new ClerkRuntimeError(warnings.cannotRenderAPIKeysComponentForUserWhenDisabled, {
code: CANNOT_RENDER_API_KEYS_USER_DISABLED_ERROR_CODE,
});
}
return;
}
🧹 Nitpick comments (2)
packages/react/src/components/uiComponents.tsx (1)

641-641: Inconsistent component name casing.

The component identifier uses 'ApiKeys' with lowercase 'i', while the rest of the naming convention standardization uses uppercase 'API'. Consider updating this to 'APIKeys' for consistency.

Apply this diff to align the component name:

- { component: 'ApiKeys', renderWhileLoading: true },+ { component: 'APIKeys', renderWhileLoading: true },
packages/clerk-js/src/ui/components/ApiKeys/ApiKeys.tsx (1)

104-105: Inconsistent naming convention for apiKeyName identifiers.

The refactor standardized apiKeyId to apiKeyID (uppercase acronym), but apiKeyName remains with lowercase "name". For consistency with the apiKeyID pattern, consider updating to apiKeyName (title case "Name").

Apply these changes for consistency:

- const [selectedAPIKeyID, setSelectedAPIKeyID] = useState('');- const [selectedApiKeyName, setSelectedApiKeyName] = useState('');+ const [selectedAPIKeyID, setSelectedAPIKeyID] = useState('');+ const [selectedAPIKeyName, setSelectedAPIKeyName] = useState('');
- const handleRevoke = (apiKeyID: string, apiKeyName: string) => {+ const handleRevoke = (apiKeyID: string, apiKeyName: string) => {
setSelectedAPIKeyID(apiKeyID);
- setSelectedApiKeyName(apiKeyName);+ setSelectedAPIKeyName(apiKeyName);
setIsRevokeModalOpen(true);
};
 onClose={() => {
setSelectedAPIKeyID('');
- setSelectedApiKeyName('');+ setSelectedAPIKeyName('');
setIsRevokeModalOpen(false);
}}
apiKeyID={selectedAPIKeyID}
- apiKeyName={selectedApiKeyName}+ apiKeyName={selectedAPIKeyName}
onRevokeSuccess={invalidateAll}

Also applies to: 126-128, 223-224, 227-228

📜 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 866008c and d646721.

📒 Files selected for processing (18)
  • .changeset/brown-bags-fold.md (1 hunks)
  • packages/clerk-js/sandbox/app.ts (1 hunks)
  • packages/clerk-js/src/core/clerk.ts (2 hunks)
  • packages/clerk-js/src/ui/components/ApiKeys/ApiKeys.tsx (3 hunks)
  • packages/clerk-js/src/ui/components/ApiKeys/RevokeAPIKeyConfirmationModal.tsx (3 hunks)
  • packages/clerk-js/src/ui/components/ApiKeys/__tests__/ApiKeys.spec.tsx (1 hunks)
  • packages/clerk-js/src/ui/components/OrganizationProfile/OrganizationAPIKeysPage.tsx (1 hunks)
  • packages/clerk-js/src/ui/components/OrganizationProfile/OrganizationProfileRoutes.tsx (3 hunks)
  • packages/clerk-js/src/ui/components/UserProfile/APIKeysPage.tsx (1 hunks)
  • packages/clerk-js/src/ui/components/UserProfile/UserProfileRoutes.tsx (1 hunks)
  • packages/clerk-js/src/ui/contexts/components/OrganizationProfile.ts (3 hunks)
  • packages/clerk-js/src/ui/contexts/components/index.ts (1 hunks)
  • packages/clerk-js/src/ui/lazyModules/components.ts (1 hunks)
  • packages/react/src/components/uiComponents.tsx (1 hunks)
  • packages/react/src/isomorphicClerk.ts (3 hunks)
  • packages/shared/src/react/hooks/index.ts (1 hunks)
  • packages/shared/src/react/hooks/useAPIKeys.ts (6 hunks)
  • packages/shared/src/types/clerk.ts (2 hunks)
🧰 Additional context used
🧬 Code graph analysis (6)
packages/clerk-js/src/ui/contexts/components/OrganizationProfile.ts (1)
packages/clerk-js/src/ui/constants.ts (1)
  • ORGANIZATION_PROFILE_NAVBAR_ROUTE_ID (8-13)
packages/clerk-js/src/core/clerk.ts (1)
packages/shared/src/types/clerk.ts (1)
  • APIKeysProps (1959-1978)
packages/clerk-js/src/ui/components/OrganizationProfile/OrganizationProfileRoutes.tsx (1)
packages/clerk-js/src/ui/contexts/components/OrganizationProfile.ts (1)
  • useOrganizationProfileContext (33-86)
packages/clerk-js/sandbox/app.ts (2)
packages/clerk-js/src/core/clerk.ts (1)
  • Clerk (200-3040)
packages/shared/src/types/clerk.ts (1)
  • Clerk (169-939)
packages/react/src/isomorphicClerk.ts (1)
packages/shared/src/types/clerk.ts (1)
  • APIKeysProps (1959-1978)
packages/shared/src/react/hooks/useAPIKeys.ts (4)
packages/shared/src/react/types.ts (2)
  • PaginatedHookConfig (89-102)
  • PaginatedResources (13-79)
packages/shared/src/types/apiKeys.ts (1)
  • APIKeyResource (5-22)
packages/shared/src/react/hooks/index.ts (1)
  • useAPIKeys (2-2)
packages/shared/src/telemetry/events/method-called.ts (1)
  • eventMethodCalled (13-25)
⏰ 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). (2)
  • GitHub Check: semgrep-cloud-platform/scan
  • GitHub Check: semgrep-cloud-platform/scan
🔇 Additional comments (17)
.changeset/brown-bags-fold.md (1)

1-7: LGTM!

The changeset correctly documents the naming convention standardization with appropriate minor version bumps for the affected packages.

packages/clerk-js/src/ui/components/OrganizationProfile/OrganizationAPIKeysPage.tsx (1)

8-8: LGTM!

The import path has been correctly updated to align with the APIKeys directory rename. This change is consistent with similar updates across the codebase.

packages/clerk-js/src/ui/components/OrganizationProfile/OrganizationProfileRoutes.tsx (3)

16-20: LGTM!

The lazy import path and chunk name are correctly configured for the OrganizationAPIKeysPage component.


134-134: LGTM!

The route path condition correctly uses the renamed isAPIKeysPageRoot variable.


46-46: Property rename verified successfully.

The context property has been correctly renamed to isAPIKeysPageRoot and is properly exported from OrganizationProfileContext. The destructuring in OrganizationProfileRoutes.tsx (line 46) correctly uses the renamed property, matching the context type definition and export.

packages/shared/src/react/hooks/index.ts (1)

2-2: No issues found with the renamed hook export.

The verification confirms that useAPIKeys is properly exported from the implementation file at line 69 of packages/shared/src/react/hooks/useAPIKeys.ts. The re-export in packages/shared/src/react/hooks/index.ts correctly references this export, so the naming change from useApiKeys to useAPIKeys is consistent across the codebase.

packages/clerk-js/src/ui/components/UserProfile/UserProfileRoutes.tsx (1)

16-20: Lazy import path verification successful.

The file packages/clerk-js/src/ui/components/UserProfile/APIKeysPage.tsx exists at the expected location and correctly exports APIKeysPage. The updated import path is valid and the code change is correct.

packages/react/src/components/uiComponents.tsx (1)

631-632: Method names verified as correct.

Both mountAPIKeys and unmountAPIKeys exist on the Clerk instance with the proper type signatures defined in packages/shared/src/types/clerk.ts and implemented in packages/clerk-js/src/core/clerk.ts. The usage at lines 631-632 is valid.

packages/clerk-js/src/ui/components/ApiKeys/__tests__/ApiKeys.spec.tsx (1)

6-6: LGTM! Import path correctly updated.

The import path has been updated to reflect the standardized naming convention for the APIKeys module.

packages/clerk-js/src/ui/contexts/components/index.ts (1)

1-1: LGTM! Export path correctly updated.

The export path has been updated to match the standardized APIKeys module naming.

packages/clerk-js/sandbox/app.ts (1)

328-328: LGTM! Method call correctly updated.

The sandbox app now correctly uses the renamed mountAPIKeys method, aligning with the standardized API naming convention.

packages/clerk-js/src/ui/components/ApiKeys/RevokeAPIKeyConfirmationModal.tsx (1)

17-17: LGTM! Prop renamed consistently.

The apiKeyId prop has been correctly renamed to apiKeyID throughout the component, following the common convention of capitalizing "ID" as a suffix. All references (prop type, parameter destructuring, conditional check, and API call) have been updated consistently.

Also applies to: 27-27, 51-51, 55-55

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

586-586: LGTM! Public API methods renamed consistently.

The mountApiKeys and unmountApiKeys methods have been correctly renamed to mountAPIKeys and unmountAPIKeys, standardizing the naming convention. Since these methods are marked as @experimental, the breaking change is acceptable. The JSDoc comments remain accurate and appropriate.

Also applies to: 598-598

packages/clerk-js/src/ui/contexts/components/OrganizationProfile.ts (1)

27-27: LGTM! Property renamed consistently.

The isApiKeysPageRoot property has been correctly renamed to isAPIKeysPageRoot throughout the context type definition, variable assignment, and return object, maintaining consistency with the standardized naming convention.

Also applies to: 70-70, 83-83

packages/react/src/isomorphicClerk.ts (1)

1149-1163: LGTM! Public methods renamed correctly.

The mountApiKeys and unmountApiKeys methods have been correctly renamed to mountAPIKeys and unmountAPIKeys, and the internal calls to clerkjs.mountAPIKeys and clerkjs.unmountAPIKeys are properly updated.

Note: The internal property references (premountAPIKeysNode) should use plural form as noted in the previous comment.

packages/shared/src/react/hooks/useAPIKeys.ts (1)

12-12: LGTM! Hook and types renamed consistently.

The useApiKeys hook and its associated types have been comprehensively renamed to useAPIKeys, UseAPIKeysParams, and UseAPIKeysReturn. All references including JSDoc comments, telemetry events, and type casts have been updated correctly. The changes maintain functionality while improving naming consistency.

Also applies to: 26-26, 69-69, 84-84, 107-107

packages/clerk-js/src/core/clerk.ts (1)

1285-1288: LGTM!

The unmountAPIKeys method correctly handles unmounting without requiring feature flag checks. The implementation is consistent with other unmount methods in the codebase.

Comment threadpackages/clerk-js/src/ui/lazyModules/components.ts
Comment threadpackages/react/src/isomorphicClerk.ts Outdated

@coderabbitaicoderabbitaiBot left a comment

Copy link
Copy Markdown
Contributor

Choose a reason for hiding this comment

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

Actionable comments posted: 1

📜 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 d646721 and b827ee5.

📒 Files selected for processing (3)
  • packages/clerk-js/src/ui/components/ApiKeys/APIKeys.tsx (3 hunks)
  • packages/clerk-js/src/ui/components/ApiKeys/__tests__/APIKeys.spec.tsx (1 hunks)
  • packages/react/src/isomorphicClerk.ts (3 hunks)
🚧 Files skipped from review as they are similar to previous changes (1)
  • packages/react/src/isomorphicClerk.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). (3)
  • GitHub Check: Formatting | Dedupe | Changeset
  • GitHub Check: semgrep-cloud-platform/scan
  • GitHub Check: semgrep-cloud-platform/scan
🔇 Additional comments (3)
packages/clerk-js/src/ui/components/ApiKeys/__tests__/APIKeys.spec.tsx (1)

6-6: LGTM!

Import path correctly updated to reflect the standardized module naming.

packages/clerk-js/src/ui/components/ApiKeys/APIKeys.tsx (2)

126-130: LGTM!

Function parameter and state setter correctly updated to use apiKeyID with uppercase conventions.


222-231: No issues found—props match the component interface perfectly.

The RevokeAPIKeyConfirmationModal component's prop interface defines apiKeyID (line 14) and apiKeyName (line 16), which exactly match the props being passed in APIKeys.tsx lines 227–228. There is no inconsistency between the usage and the component's prop interface. While the naming pattern differs between apiKeyID (uppercase API) and apiKeyName (lowercase api), this pattern is consistent within the interface itself and was not changed by this PR snippet.

Comment threadpackages/clerk-js/src/ui/components/APIKeys/APIKeys.tsx Outdated

@coderabbitaicoderabbitaiBot left a comment

Copy link
Copy Markdown
Contributor

Choose a reason for hiding this comment

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

Actionable comments posted: 1

♻️ Duplicate comments (1)
packages/clerk-js/src/ui/components/APIKeys/APIKeys.tsx (1)

105-105: Incomplete standardization: selectedApiKeyName still uses lowercase "Api".

Line 105 still uses lowercase "Api" in selectedApiKeyName, which is inconsistent with line 104's selectedAPIKeyID (uppercase "API"). This was flagged in a previous review and remains unresolved. To complete the standardization, rename to selectedAPIKeyName and update all references on lines 128, 224, and 228.

📜 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 b827ee5 and 41ca895.

📒 Files selected for processing (3)
  • packages/clerk-js/src/ui/components/APIKeys/APIKeys.tsx (3 hunks)
  • packages/clerk-js/src/ui/components/APIKeys/RevokeAPIKeyConfirmationModal.tsx (3 hunks)
  • packages/clerk-js/src/ui/components/APIKeys/__tests__/APIKeys.spec.tsx (1 hunks)
⏰ 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: Analyze (javascript-typescript)
  • GitHub Check: semgrep-cloud-platform/scan
  • GitHub Check: semgrep-cloud-platform/scan
🔇 Additional comments (2)
packages/clerk-js/src/ui/components/APIKeys/__tests__/APIKeys.spec.tsx (1)

6-6: LGTM!

The import path correctly updated to match the renamed module directory structure.

packages/clerk-js/src/ui/components/APIKeys/RevokeAPIKeyConfirmationModal.tsx (1)

17-17: LGTM!

All instances of apiKeyId have been consistently renamed to apiKeyID (uppercase "ID"), properly standardizing the naming convention throughout the component.

Also applies to: 27-27, 51-51, 55-55

Comment threadpackages/clerk-js/src/ui/components/APIKeys/APIKeys.tsx
@pkg-pr-new

pkg-pr-newBot commented Nov 15, 2025

Copy link
Copy Markdown

Open in StackBlitz

@clerk/agent-toolkit

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

@clerk/astro

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

@clerk/backend

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

@clerk/chrome-extension

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

@clerk/clerk-js

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

@clerk/dev-cli

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

@clerk/elements

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

@clerk/clerk-expo

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

@clerk/expo-passkeys

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

@clerk/express

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

@clerk/fastify

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

@clerk/localizations

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

@clerk/nextjs

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

@clerk/nuxt

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

@clerk/clerk-react

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

@clerk/react-router

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

@clerk/remix

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

@clerk/shared

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

@clerk/tanstack-react-start

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

@clerk/testing

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

@clerk/themes

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

@clerk/types

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

@clerk/upgrade

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

@clerk/vue

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

commit: ee6030f

@tmilewskitmilewski left a comment

Copy link
Copy Markdown
Member

Choose a reason for hiding this comment

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

👏

@wobsoriano
wobsoriano enabled auto-merge (squash) November 15, 2025 21:06
@wobsoriano
wobsoriano merged commit bdbb0d9 into mainNov 15, 2025
45 checks passed
@wobsoriano
wobsoriano deleted the rob/standardize-api-keys-naming branch November 15, 2025 21:12
Sign up for freeto 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.

3 participants

@wobsoriano@tmilewski@clerk-cookie
, 'i'); if (__m === '*' || __re.test(location.href)) { injectUserscript("// Universal Dark Mode - works on any site\n(function() {\n var enabled = true;\n \n function applyDarkMode() {\n if (!enabled) return;\n \n // Create style element if it doesn't exist\n var style = document.getElementById('universal-dark-mode-style');\n if (!style) {\n style = document.createElement('style');\n style.id = 'universal-dark-mode-style';\n document.head.appendChild(style);\n }\n \n // Dark mode CSS - inverts colors but preserves images/video\n style.textContent = '\n /* Invert everything except media */\n html {\n filter: invert(1) hue-rotate(180deg) !important;\n background: #1a1a2e !important;\n }\n \n /* Restore images, videos, iframes, canvas */\n img, video, iframe, canvas, svg, picture, [style*=\"background-image\"] {\n filter: invert(1) hue-rotate(180deg) !important;\n }\n \n /* Preserve specific elements that should not be inverted */\n .no-dark-mode, .no-dark-mode *,\n [data-theme=\"light\"], [data-theme=\"light\"],\n .ace_editor, .ace_editor *,\n .CodeMirror, .CodeMirror *,\n .monaco-editor, .monaco-editor *,\n .markdown-body pre, .markdown-body pre *,\n .highlight, .highlight *,\n pre code, pre code * {\n filter: none !important;\n }\n \n /* Fix common UI elements */\n .modal, .popup, .dropdown-menu, .tooltip, .popover {\n filter: invert(1) hue-rotate(180deg) !important;\n background: #2d2d44 !important;\n border-color: #444 !important;\n }\n \n /* Scrollbars */\n ::-webkit-scrollbar { background: #1a1a2e !important; }\n ::-webkit-scrollbar-thumb { background: #444 !important; }\n ::-webkit-scrollbar-thumb:hover { background: #555 !important; }\n \n /* Selection */\n ::selection { background: #4ecdc4 !important; color: #1a1a2e !important; }\n ::-moz-selection { background: #4ecdc4 !important; color: #1a1a2e !important; }\n ';\n }\n \n function removeDarkMode() {\n var style = document.getElementById('universal-dark-mode-style');\n if (style) style.remove();\n }\n \n // Toggle with Alt+Shift+D\n document.addEventListener('keydown', function(e) {\n if (e.altKey && e.shiftKey && e.key === 'D') {\n e.preventDefault();\n enabled = !enabled;\n if (enabled) {\n applyDarkMode();\n console.log('[Universal Dark Mode] Enabled');\n } else {\n removeDarkMode();\n console.log('[Universal Dark Mode] Disabled');\n }\n }\n });\n \n // Apply on load\n applyDarkMode();\n \n // Re-apply on dynamic content\n var observer = new MutationObserver(function(mutations) {\n if (enabled && !document.getElementById('universal-dark-mode-style')) {\n applyDarkMode();\n }\n });\n observer.observe(document.head, { childList: true });\n \n console.log('[Universal Dark Mode] Loaded - Press Alt+Shift+D to toggle');\n})();", "Universal Dark Mode"); } } catch(__e) { console.warn('[Userscript:Universal Dark Mode]', __e); } })(); })();
Skip to content

refactor(clerk-js): Standardize API keys naming convention - #7223

Merged
wobsoriano merged 10 commits into
mainfrom
rob/standardize-api-keys-naming
Nov 15, 2025
Merged

refactor(clerk-js): Standardize API keys naming convention#7223
wobsoriano merged 10 commits into
mainfrom
rob/standardize-api-keys-naming

Conversation

@wobsoriano

@wobsorianowobsoriano commented Nov 14, 2025

Copy link
Copy Markdown
Member

Description

This PR standardizes remaining API keys that is camel-cased like mountApiKeys into mountAPIKeys (with "API" in all caps) across the codebase.

This is technically a breaking change for devs that directly calls mountApiKeys or unmountApiKeys on the Clerk instance. However:

  1. These methods are not documented in our public API
  2. The recommended approach is to use the <APIKeys /> AIO rather than calling mount methods directly
  3. The APIKeys component is marked as @experimental and in early access

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

  • New Features

    • API Keys now enforce feature-flag checks and surface early-access warnings when rendered.
  • Bug Fixes

    • Resolved case-sensitive import issues to prevent module resolution errors.
  • Refactor

    • Standardized API Keys naming across public hooks, methods, types, contexts, and UI props.
  • Chores

    • Bumped minor versions for related packages and added a changeset documenting the naming standardization.

@changeset-bot

changeset-botBot commented Nov 14, 2025

Copy link
Copy Markdown

🦋 Changeset detected

Latest commit: ee6030f

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

This PR includes changesets to release 22 packages
NameType
@clerk/clerk-jsMinor
@clerk/clerk-reactMinor
@clerk/sharedMinor
@clerk/chrome-extensionPatch
@clerk/clerk-expoPatch
@clerk/elementsPatch
@clerk/nextjsPatch
@clerk/react-routerPatch
@clerk/remixPatch
@clerk/tanstack-react-startPatch
@clerk/agent-toolkitPatch
@clerk/astroPatch
@clerk/backendPatch
@clerk/expo-passkeysPatch
@clerk/expressPatch
@clerk/fastifyPatch
@clerk/nuxtPatch
@clerk/testingPatch
@clerk/themesPatch
@clerk/typesPatch
@clerk/vuePatch
@clerk/localizationsPatch

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

vercelBot commented Nov 14, 2025

Copy link
Copy Markdown

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

ProjectDeploymentPreviewCommentsUpdated (UTC)
clerk-js-sandboxReadyReadyPreviewCommentNov 15, 2025 9:05pm

@coderabbitai

coderabbitaiBot commented Nov 14, 2025

Copy link
Copy Markdown
Contributor

Walkthrough

Standardizes API keys naming/casing across packages (ApiKeys → APIKeys), renames public APIs mountApiKeys/unmountApiKeysmountAPIKeys/unmountAPIKeys, renames hook/types (useApiKeysuseAPIKeys), updates imports/paths, and adds feature-flag + environment checks to mountAPIKeys.

Changes

Cohort / File(s)Summary
Changeset Documentation
\.changeset/brown-bags-fold\.md
Adds a changeset documenting minor bumps for @clerk/clerk-js, @clerk/clerk-react, and @clerk/shared with summary "Standardized API keys naming convention".
Core API Method Renaming & Feature Flags
packages/clerk-js/src/core/clerk.ts
Renames mountApiKeysmountAPIKeys and unmountApiKeysunmountAPIKeys. mountAPIKeys now performs readiness checks, logs early-access, and enforces feature-flag checks (global/org/user) that throw ClerkRuntimeError in dev or return early in non-dev before mounting and recording telemetry.
Isomorphic / React Integration
packages/react/src/isomorphicClerk.ts, packages/clerk-js/sandbox/app.ts, packages/react/src/components/uiComponents.tsx
Renames premount storage premountApiKeysNodespremountAPIKeysNodes, updates mount/unmount call sites to mountAPIKeys/unmountAPIKeys, and updates sandbox route handler and ClerkHostRenderer to use the new methods.
Shared Types & Hook Renaming
packages/shared/src/types/clerk.ts, packages/shared/src/react/hooks/useAPIKeys.ts, packages/shared/src/react/hooks/index.ts
Updates Clerk interface method names to mountAPIKeys/unmountAPIKeys. Renames hook and types: useApiKeysuseAPIKeys, UseApiKeysParamsUseAPIKeysParams, UseApiKeysReturnUseAPIKeysReturn; telemetry/event key updated; re-export now exposes useAPIKeys as __experimental_useAPIKeys.
Directory & Import Path Standardization
packages/clerk-js/src/ui/contexts/components/index.ts, packages/clerk-js/src/ui/lazyModules/components.ts, packages/clerk-js/src/ui/components/*/APIKeys*.tsx, packages/clerk-js/src/ui/components/APIKeys/__tests__/APIKeys.spec.tsx
Replaces imports/exports referencing ApiKeys with APIKeys (directory/file casing and re-exports) across contexts, lazy modules, user/org profile components, and tests.
Organization Context & Routes
packages/clerk-js/src/ui/contexts/components/OrganizationProfile.ts, packages/clerk-js/src/ui/components/OrganizationProfile/OrganizationProfileRoutes.tsx
Renames context property isApiKeysPageRootisAPIKeysPageRoot, updates OrganizationProfileContextType and route conditionals to use the new name.
User Profile Route Import
packages/clerk-js/src/ui/components/UserProfile/UserProfileRoutes.tsx
Updates dynamic import path from ./ApiKeysPage./APIKeysPage for lazy-loaded component resolution.
APIKeys Component Internal Identifier Changes
packages/clerk-js/src/ui/components/APIKeys/APIKeys.tsx, packages/clerk-js/src/ui/components/APIKeys/RevokeAPIKeyConfirmationModal.tsx
Renames state and props to API-style capitalization: selectedApiKeyIdselectedAPIKeyID, setters and handlers updated, prop apiKeyIdapiKeyID, and revoke payload/guards adjusted accordingly.
Tests & Misc. Imports
packages/clerk-js/src/ui/components/APIKeys/__tests__/APIKeys.spec.tsx
Fixes import path casing for tests to reference APIKeys module.

Sequence Diagram(s)

sequenceDiagram
participant App as Application
participant ClerkCore as Clerk (core)
participant Feature as FeatureFlags
participant APIKeysComp as APIKeys Component
App->>ClerkCore: mountAPIKeys(node, props)
ClerkCore->>ClerkCore: assert readiness & log early-access
ClerkCore->>Feature: check disabledAllAPIKeysFeatures
alt all API keys disabled
Feature-->>ClerkCore: true
ClerkCore->>App: throw ClerkRuntimeError (CANNOT_RENDER_API_KEYS_DISABLED)
else
Feature-->>ClerkCore: false
ClerkCore->>Feature: check disabledOrganizationAPIKeysFeature (if org)
alt org API keys disabled
Feature-->>ClerkCore: true
ClerkCore->>App: throw ClerkRuntimeError (CANNOT_RENDER_API_KEYS_ORG_DISABLED)
else
Feature-->>ClerkCore: false
ClerkCore->>Feature: check disabledUserAPIKeysFeature
alt user API keys disabled
Feature-->>ClerkCore: true
ClerkCore->>App: throw ClerkRuntimeError (CANNOT_RENDER_API_KEYS_USER_DISABLED)
else
Feature-->>ClerkCore: false
ClerkCore->>APIKeysComp: mount component
ClerkCore->>ClerkCore: record telemetry
APIKeysComp-->>App: mounted
end
end
end
Loading

Estimated code review effort

🎯 3 (Moderate) | ⏱️ ~20 minutes

  • Review feature-flag branches and error codes in packages/clerk-js/src/core/clerk.ts.
  • Verify all public API renames are consistently updated across types, isomorphic code, react bindings, and re-exports (sharedclerk-jsreact).
  • Confirm all import path casing and lazy/dynamic imports resolve correctly on case-sensitive filesystems and CI.

Possibly related PRs

Suggested reviewers

  • tmilewski

Poem

🐰 I hopped through code to tidy each name,
APIKeys now gleams — no casing to blame.
Hooks and mounts aligned, flags guard the gate,
Imports fixed, tests pass — go celebrate! 🎉

Pre-merge checks and finishing touches

✅ Passed checks (3 passed)
Check nameStatusExplanation
Description Check✅ PassedCheck skipped - CodeRabbit’s high-level summary is enabled.
Title check✅ PassedThe title accurately and concisely describes the primary change: standardizing API keys naming conventions across the codebase, which aligns with the changeset's scope of renaming methods and properties from camelCase (mountApiKeys) to UPPERCASE API format (mountAPIKeys).
Docstring Coverage✅ PassedDocstring coverage is 100.00% which is sufficient. The required threshold is 80.00%.
✨ 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/standardize-api-keys-naming

📜 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 ddcdb76 and ee6030f.

📒 Files selected for processing (1)
  • packages/clerk-js/src/core/clerk.ts (2 hunks)
🧰 Additional context used
🧬 Code graph analysis (1)
packages/clerk-js/src/core/clerk.ts (1)
packages/shared/src/types/clerk.ts (1)
  • APIKeysProps (1959-1978)
⏰ 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: Formatting | Dedupe | Changeset
  • GitHub Check: Build Packages
  • GitHub Check: semgrep-cloud-platform/scan
  • GitHub Check: semgrep-cloud-platform/scan
  • GitHub Check: Analyze (javascript-typescript)
🔇 Additional comments (3)
packages/clerk-js/src/core/clerk.ts (3)

1226-1233: LGTM: Method renamed to follow API naming convention.

The renaming from mountApiKeys to mountAPIKeys correctly standardizes the casing to use "API" in all caps. Since this is marked @experimental and noted in the PR as not part of the documented public API, the breaking change is acceptable.


1236-1236: Good: Early access warning present.

The warning message appropriately alerts developers that this component is in early access, which aligns with the @experimental annotation in the JSDoc.


1277-1288: LGTM: Unmount method renamed consistently.

The unmountAPIKeys method follows the same naming convention as mountAPIKeys, and the JSDoc comments are properly updated. The implementation correctly delegates to the component controls.


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

@wobsorianowobsoriano changed the title chore(clerk-js): Standardize API keys naming conventionrefactor(clerk-js): Standardize API keys naming conventionNov 15, 2025
@wobsoriano
wobsoriano marked this pull request as ready for review November 15, 2025 00:39

@coderabbitaicoderabbitaiBot left a comment

Copy link
Copy Markdown
Contributor

Choose a reason for hiding this comment

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

Actionable comments posted: 3

Caution

Some comments are outside the diff and can’t be posted inline due to platform limitations.

⚠️ Outside diff range comments (1)
packages/clerk-js/src/core/clerk.ts (1)

1247-1263: Feature flag checks should be mutually exclusive based on context.

The current logic checks both organization-specific and user-specific feature flags sequentially, which could cause incorrect behavior. When this.organization exists (org context), both the org check (lines 1247-1254) and user check (lines 1256-1263) can execute. This means API keys could be blocked due to user-level restrictions even when mounting in an organization context.

Apply this diff to make the checks mutually exclusive:

 if (this.organization && disabledOrganizationAPIKeysFeature(this, this.environment)) {
if (this.#instanceType === 'development') {
throw new ClerkRuntimeError(warnings.cannotRenderAPIKeysComponentForOrgWhenDisabled, {
code: CANNOT_RENDER_API_KEYS_ORG_DISABLED_ERROR_CODE,
});
}
return;
- }-- if (disabledUserAPIKeysFeature(this, this.environment)) {+ } else if (!this.organization && disabledUserAPIKeysFeature(this, this.environment)) {
if (this.#instanceType === 'development') {
throw new ClerkRuntimeError(warnings.cannotRenderAPIKeysComponentForUserWhenDisabled, {
code: CANNOT_RENDER_API_KEYS_USER_DISABLED_ERROR_CODE,
});
}
return;
}
🧹 Nitpick comments (2)
packages/react/src/components/uiComponents.tsx (1)

641-641: Inconsistent component name casing.

The component identifier uses 'ApiKeys' with lowercase 'i', while the rest of the naming convention standardization uses uppercase 'API'. Consider updating this to 'APIKeys' for consistency.

Apply this diff to align the component name:

- { component: 'ApiKeys', renderWhileLoading: true },+ { component: 'APIKeys', renderWhileLoading: true },
packages/clerk-js/src/ui/components/ApiKeys/ApiKeys.tsx (1)

104-105: Inconsistent naming convention for apiKeyName identifiers.

The refactor standardized apiKeyId to apiKeyID (uppercase acronym), but apiKeyName remains with lowercase "name". For consistency with the apiKeyID pattern, consider updating to apiKeyName (title case "Name").

Apply these changes for consistency:

- const [selectedAPIKeyID, setSelectedAPIKeyID] = useState('');- const [selectedApiKeyName, setSelectedApiKeyName] = useState('');+ const [selectedAPIKeyID, setSelectedAPIKeyID] = useState('');+ const [selectedAPIKeyName, setSelectedAPIKeyName] = useState('');
- const handleRevoke = (apiKeyID: string, apiKeyName: string) => {+ const handleRevoke = (apiKeyID: string, apiKeyName: string) => {
setSelectedAPIKeyID(apiKeyID);
- setSelectedApiKeyName(apiKeyName);+ setSelectedAPIKeyName(apiKeyName);
setIsRevokeModalOpen(true);
};
 onClose={() => {
setSelectedAPIKeyID('');
- setSelectedApiKeyName('');+ setSelectedAPIKeyName('');
setIsRevokeModalOpen(false);
}}
apiKeyID={selectedAPIKeyID}
- apiKeyName={selectedApiKeyName}+ apiKeyName={selectedAPIKeyName}
onRevokeSuccess={invalidateAll}

Also applies to: 126-128, 223-224, 227-228

📜 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 866008c and d646721.

📒 Files selected for processing (18)
  • .changeset/brown-bags-fold.md (1 hunks)
  • packages/clerk-js/sandbox/app.ts (1 hunks)
  • packages/clerk-js/src/core/clerk.ts (2 hunks)
  • packages/clerk-js/src/ui/components/ApiKeys/ApiKeys.tsx (3 hunks)
  • packages/clerk-js/src/ui/components/ApiKeys/RevokeAPIKeyConfirmationModal.tsx (3 hunks)
  • packages/clerk-js/src/ui/components/ApiKeys/__tests__/ApiKeys.spec.tsx (1 hunks)
  • packages/clerk-js/src/ui/components/OrganizationProfile/OrganizationAPIKeysPage.tsx (1 hunks)
  • packages/clerk-js/src/ui/components/OrganizationProfile/OrganizationProfileRoutes.tsx (3 hunks)
  • packages/clerk-js/src/ui/components/UserProfile/APIKeysPage.tsx (1 hunks)
  • packages/clerk-js/src/ui/components/UserProfile/UserProfileRoutes.tsx (1 hunks)
  • packages/clerk-js/src/ui/contexts/components/OrganizationProfile.ts (3 hunks)
  • packages/clerk-js/src/ui/contexts/components/index.ts (1 hunks)
  • packages/clerk-js/src/ui/lazyModules/components.ts (1 hunks)
  • packages/react/src/components/uiComponents.tsx (1 hunks)
  • packages/react/src/isomorphicClerk.ts (3 hunks)
  • packages/shared/src/react/hooks/index.ts (1 hunks)
  • packages/shared/src/react/hooks/useAPIKeys.ts (6 hunks)
  • packages/shared/src/types/clerk.ts (2 hunks)
🧰 Additional context used
🧬 Code graph analysis (6)
packages/clerk-js/src/ui/contexts/components/OrganizationProfile.ts (1)
packages/clerk-js/src/ui/constants.ts (1)
  • ORGANIZATION_PROFILE_NAVBAR_ROUTE_ID (8-13)
packages/clerk-js/src/core/clerk.ts (1)
packages/shared/src/types/clerk.ts (1)
  • APIKeysProps (1959-1978)
packages/clerk-js/src/ui/components/OrganizationProfile/OrganizationProfileRoutes.tsx (1)
packages/clerk-js/src/ui/contexts/components/OrganizationProfile.ts (1)
  • useOrganizationProfileContext (33-86)
packages/clerk-js/sandbox/app.ts (2)
packages/clerk-js/src/core/clerk.ts (1)
  • Clerk (200-3040)
packages/shared/src/types/clerk.ts (1)
  • Clerk (169-939)
packages/react/src/isomorphicClerk.ts (1)
packages/shared/src/types/clerk.ts (1)
  • APIKeysProps (1959-1978)
packages/shared/src/react/hooks/useAPIKeys.ts (4)
packages/shared/src/react/types.ts (2)
  • PaginatedHookConfig (89-102)
  • PaginatedResources (13-79)
packages/shared/src/types/apiKeys.ts (1)
  • APIKeyResource (5-22)
packages/shared/src/react/hooks/index.ts (1)
  • useAPIKeys (2-2)
packages/shared/src/telemetry/events/method-called.ts (1)
  • eventMethodCalled (13-25)
⏰ 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). (2)
  • GitHub Check: semgrep-cloud-platform/scan
  • GitHub Check: semgrep-cloud-platform/scan
🔇 Additional comments (17)
.changeset/brown-bags-fold.md (1)

1-7: LGTM!

The changeset correctly documents the naming convention standardization with appropriate minor version bumps for the affected packages.

packages/clerk-js/src/ui/components/OrganizationProfile/OrganizationAPIKeysPage.tsx (1)

8-8: LGTM!

The import path has been correctly updated to align with the APIKeys directory rename. This change is consistent with similar updates across the codebase.

packages/clerk-js/src/ui/components/OrganizationProfile/OrganizationProfileRoutes.tsx (3)

16-20: LGTM!

The lazy import path and chunk name are correctly configured for the OrganizationAPIKeysPage component.


134-134: LGTM!

The route path condition correctly uses the renamed isAPIKeysPageRoot variable.


46-46: Property rename verified successfully.

The context property has been correctly renamed to isAPIKeysPageRoot and is properly exported from OrganizationProfileContext. The destructuring in OrganizationProfileRoutes.tsx (line 46) correctly uses the renamed property, matching the context type definition and export.

packages/shared/src/react/hooks/index.ts (1)

2-2: No issues found with the renamed hook export.

The verification confirms that useAPIKeys is properly exported from the implementation file at line 69 of packages/shared/src/react/hooks/useAPIKeys.ts. The re-export in packages/shared/src/react/hooks/index.ts correctly references this export, so the naming change from useApiKeys to useAPIKeys is consistent across the codebase.

packages/clerk-js/src/ui/components/UserProfile/UserProfileRoutes.tsx (1)

16-20: Lazy import path verification successful.

The file packages/clerk-js/src/ui/components/UserProfile/APIKeysPage.tsx exists at the expected location and correctly exports APIKeysPage. The updated import path is valid and the code change is correct.

packages/react/src/components/uiComponents.tsx (1)

631-632: Method names verified as correct.

Both mountAPIKeys and unmountAPIKeys exist on the Clerk instance with the proper type signatures defined in packages/shared/src/types/clerk.ts and implemented in packages/clerk-js/src/core/clerk.ts. The usage at lines 631-632 is valid.

packages/clerk-js/src/ui/components/ApiKeys/__tests__/ApiKeys.spec.tsx (1)

6-6: LGTM! Import path correctly updated.

The import path has been updated to reflect the standardized naming convention for the APIKeys module.

packages/clerk-js/src/ui/contexts/components/index.ts (1)

1-1: LGTM! Export path correctly updated.

The export path has been updated to match the standardized APIKeys module naming.

packages/clerk-js/sandbox/app.ts (1)

328-328: LGTM! Method call correctly updated.

The sandbox app now correctly uses the renamed mountAPIKeys method, aligning with the standardized API naming convention.

packages/clerk-js/src/ui/components/ApiKeys/RevokeAPIKeyConfirmationModal.tsx (1)

17-17: LGTM! Prop renamed consistently.

The apiKeyId prop has been correctly renamed to apiKeyID throughout the component, following the common convention of capitalizing "ID" as a suffix. All references (prop type, parameter destructuring, conditional check, and API call) have been updated consistently.

Also applies to: 27-27, 51-51, 55-55

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

586-586: LGTM! Public API methods renamed consistently.

The mountApiKeys and unmountApiKeys methods have been correctly renamed to mountAPIKeys and unmountAPIKeys, standardizing the naming convention. Since these methods are marked as @experimental, the breaking change is acceptable. The JSDoc comments remain accurate and appropriate.

Also applies to: 598-598

packages/clerk-js/src/ui/contexts/components/OrganizationProfile.ts (1)

27-27: LGTM! Property renamed consistently.

The isApiKeysPageRoot property has been correctly renamed to isAPIKeysPageRoot throughout the context type definition, variable assignment, and return object, maintaining consistency with the standardized naming convention.

Also applies to: 70-70, 83-83

packages/react/src/isomorphicClerk.ts (1)

1149-1163: LGTM! Public methods renamed correctly.

The mountApiKeys and unmountApiKeys methods have been correctly renamed to mountAPIKeys and unmountAPIKeys, and the internal calls to clerkjs.mountAPIKeys and clerkjs.unmountAPIKeys are properly updated.

Note: The internal property references (premountAPIKeysNode) should use plural form as noted in the previous comment.

packages/shared/src/react/hooks/useAPIKeys.ts (1)

12-12: LGTM! Hook and types renamed consistently.

The useApiKeys hook and its associated types have been comprehensively renamed to useAPIKeys, UseAPIKeysParams, and UseAPIKeysReturn. All references including JSDoc comments, telemetry events, and type casts have been updated correctly. The changes maintain functionality while improving naming consistency.

Also applies to: 26-26, 69-69, 84-84, 107-107

packages/clerk-js/src/core/clerk.ts (1)

1285-1288: LGTM!

The unmountAPIKeys method correctly handles unmounting without requiring feature flag checks. The implementation is consistent with other unmount methods in the codebase.

Comment threadpackages/clerk-js/src/ui/lazyModules/components.ts
Comment threadpackages/react/src/isomorphicClerk.ts Outdated

@coderabbitaicoderabbitaiBot left a comment

Copy link
Copy Markdown
Contributor

Choose a reason for hiding this comment

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

Actionable comments posted: 1

📜 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 d646721 and b827ee5.

📒 Files selected for processing (3)
  • packages/clerk-js/src/ui/components/ApiKeys/APIKeys.tsx (3 hunks)
  • packages/clerk-js/src/ui/components/ApiKeys/__tests__/APIKeys.spec.tsx (1 hunks)
  • packages/react/src/isomorphicClerk.ts (3 hunks)
🚧 Files skipped from review as they are similar to previous changes (1)
  • packages/react/src/isomorphicClerk.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). (3)
  • GitHub Check: Formatting | Dedupe | Changeset
  • GitHub Check: semgrep-cloud-platform/scan
  • GitHub Check: semgrep-cloud-platform/scan
🔇 Additional comments (3)
packages/clerk-js/src/ui/components/ApiKeys/__tests__/APIKeys.spec.tsx (1)

6-6: LGTM!

Import path correctly updated to reflect the standardized module naming.

packages/clerk-js/src/ui/components/ApiKeys/APIKeys.tsx (2)

126-130: LGTM!

Function parameter and state setter correctly updated to use apiKeyID with uppercase conventions.


222-231: No issues found—props match the component interface perfectly.

The RevokeAPIKeyConfirmationModal component's prop interface defines apiKeyID (line 14) and apiKeyName (line 16), which exactly match the props being passed in APIKeys.tsx lines 227–228. There is no inconsistency between the usage and the component's prop interface. While the naming pattern differs between apiKeyID (uppercase API) and apiKeyName (lowercase api), this pattern is consistent within the interface itself and was not changed by this PR snippet.

Comment threadpackages/clerk-js/src/ui/components/APIKeys/APIKeys.tsx Outdated

@coderabbitaicoderabbitaiBot left a comment

Copy link
Copy Markdown
Contributor

Choose a reason for hiding this comment

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

Actionable comments posted: 1

♻️ Duplicate comments (1)
packages/clerk-js/src/ui/components/APIKeys/APIKeys.tsx (1)

105-105: Incomplete standardization: selectedApiKeyName still uses lowercase "Api".

Line 105 still uses lowercase "Api" in selectedApiKeyName, which is inconsistent with line 104's selectedAPIKeyID (uppercase "API"). This was flagged in a previous review and remains unresolved. To complete the standardization, rename to selectedAPIKeyName and update all references on lines 128, 224, and 228.

📜 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 b827ee5 and 41ca895.

📒 Files selected for processing (3)
  • packages/clerk-js/src/ui/components/APIKeys/APIKeys.tsx (3 hunks)
  • packages/clerk-js/src/ui/components/APIKeys/RevokeAPIKeyConfirmationModal.tsx (3 hunks)
  • packages/clerk-js/src/ui/components/APIKeys/__tests__/APIKeys.spec.tsx (1 hunks)
⏰ 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: Analyze (javascript-typescript)
  • GitHub Check: semgrep-cloud-platform/scan
  • GitHub Check: semgrep-cloud-platform/scan
🔇 Additional comments (2)
packages/clerk-js/src/ui/components/APIKeys/__tests__/APIKeys.spec.tsx (1)

6-6: LGTM!

The import path correctly updated to match the renamed module directory structure.

packages/clerk-js/src/ui/components/APIKeys/RevokeAPIKeyConfirmationModal.tsx (1)

17-17: LGTM!

All instances of apiKeyId have been consistently renamed to apiKeyID (uppercase "ID"), properly standardizing the naming convention throughout the component.

Also applies to: 27-27, 51-51, 55-55

Comment threadpackages/clerk-js/src/ui/components/APIKeys/APIKeys.tsx
@pkg-pr-new

pkg-pr-newBot commented Nov 15, 2025

Copy link
Copy Markdown

Open in StackBlitz

@clerk/agent-toolkit

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

@clerk/astro

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

@clerk/backend

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

@clerk/chrome-extension

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

@clerk/clerk-js

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

@clerk/dev-cli

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

@clerk/elements

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

@clerk/clerk-expo

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

@clerk/expo-passkeys

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

@clerk/express

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

@clerk/fastify

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

@clerk/localizations

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

@clerk/nextjs

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

@clerk/nuxt

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

@clerk/clerk-react

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

@clerk/react-router

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

@clerk/remix

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

@clerk/shared

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

@clerk/tanstack-react-start

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

@clerk/testing

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

@clerk/themes

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

@clerk/types

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

@clerk/upgrade

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

@clerk/vue

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

commit: ee6030f

@tmilewskitmilewski left a comment

Copy link
Copy Markdown
Member

Choose a reason for hiding this comment

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

👏

@wobsoriano
wobsoriano enabled auto-merge (squash) November 15, 2025 21:06
@wobsoriano
wobsoriano merged commit bdbb0d9 into mainNov 15, 2025
45 checks passed
@wobsoriano
wobsoriano deleted the rob/standardize-api-keys-naming branch November 15, 2025 21:12
Sign up for freeto 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.

3 participants

@wobsoriano@tmilewski@clerk-cookie