Skip to content

Conversation

@wobsoriano
Copy link
Member

@wobsoriano wobsoriano commented Nov 5, 2025

Description

Fixes incorrect return type for clerkClient.apiKeys.list()

Screenshot 2025-11-05 at 12 47 07 PM Screenshot 2025-11-05 at 12 53 18 PM

Resolves USER-3879

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

  • Breaking Changes

    • API key list responses are now paginated; clients must handle pagination metadata when listing API keys.
  • Documentation

    • Updated documentation and packaging to reflect the paginated API key list format.
  • Chores

    • Added a changeset noting the corrected API key list response and minor version bump.

@changeset-bot
Copy link

changeset-bot bot commented Nov 5, 2025

🦋 Changeset detected

Latest commit: 88d0d63

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

This PR includes changesets to release 11 packages
Name Type
@clerk/backend Minor
@clerk/agent-toolkit Patch
@clerk/astro Patch
@clerk/express Patch
@clerk/fastify Patch
@clerk/nextjs Patch
@clerk/nuxt Patch
@clerk/react-router Patch
@clerk/remix Patch
@clerk/tanstack-react-start Patch
@clerk/testing Patch

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

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

@vercel
Copy link

vercel bot commented Nov 5, 2025

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

Project Deployment Preview Comments Updated (UTC)
clerk-js-sandbox Ready Ready Preview Comment Nov 5, 2025 8:52pm

@coderabbitai
Copy link
Contributor

coderabbitai bot commented Nov 5, 2025

Walkthrough

Updated APIKeysApi typings and imports: list() now returns PaginatedResourceResponse<APIKey[]>, ClerkPaginationRequest import path changed, and a new changeset file was added. No control-flow changes; getSecret() remains present.

Changes

Cohort / File(s) Change Summary
API Keys Endpoint Typings
packages/backend/src/api/endpoints/APIKeysApi.ts
Updated imports to use ClerkPaginationRequest from '@clerk/shared/types' and added PaginatedResourceResponse import. Changed list() return type from APIKey[] to PaginatedResourceResponse<APIKey[]>.
Changeset
.changeset/famous-planes-invent.md
Added changeset marking a patch bump with description "Fixed API keys list method return type".

Estimated code review effort

🎯 2 (Simple) | ⏱️ ~10 minutes

  • Verify callers of APIKeysAPI.list() handle the PaginatedResourceResponse wrapper.
  • Confirm the updated import path for ClerkPaginationRequest resolves correctly.
  • Check getSecret() remains usable and type-compatible.

Poem

🐰 I hopped through types and neatly pruned,

pagination wrapped the list — finely tuned,
imports hopped paths and landed right,
a tiny changeset tucked in tight,
nibbling bugs away by moonlight. 🥕

Pre-merge checks and finishing touches

✅ Passed checks (4 passed)
Check name Status Explanation
Description Check ✅ Passed Check skipped - CodeRabbit’s high-level summary is enabled.
Title check ✅ Passed The PR title accurately and specifically describes the main change: updating the return type of the API keys list method to use a paginated response type.
Linked Issues check ✅ Passed The code changes directly address the linked issue USER-3879 by correcting the TypeScript return type for apiKeys.list() to use PaginatedResourceResponse, fixing the incorrect types documented in the issue.
Out of Scope Changes check ✅ Passed All changes are directly related to fixing the API keys list method return type as specified in the linked issue; no out-of-scope modifications detected.
✨ Finishing touches
🧪 Generate unit tests (beta)
  • Create PR with unit tests
  • Post copyable unit tests in a comment
  • Commit unit tests in branch rob/user-3879-api-keys-pagination-types

📜 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 507f51d and 88d0d63.

📒 Files selected for processing (1)
  • .changeset/famous-planes-invent.md (1 hunks)
🧰 Additional context used
📓 Path-based instructions (1)
.changeset/**

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

Automated releases must use Changesets.

Files:

  • .changeset/famous-planes-invent.md
⏰ 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). (25)
  • GitHub Check: Integration Tests (quickstart, chrome, 16)
  • GitHub Check: Integration Tests (machine, chrome)
  • GitHub Check: Integration Tests (nextjs, chrome, 16)
  • GitHub Check: Integration Tests (billing, chrome)
  • GitHub Check: Integration Tests (expo-web, chrome)
  • GitHub Check: Integration Tests (nextjs, chrome, 15)
  • GitHub Check: Integration Tests (tanstack-react-start, chrome)
  • GitHub Check: Integration Tests (custom, chrome)
  • GitHub Check: Integration Tests (react-router, chrome)
  • GitHub Check: Integration Tests (elements, chrome)
  • GitHub Check: Integration Tests (sessions:staging, chrome)
  • GitHub Check: Integration Tests (quickstart, chrome, 15)
  • GitHub Check: Integration Tests (vue, chrome)
  • GitHub Check: Integration Tests (nextjs, chrome, 14)
  • GitHub Check: Integration Tests (astro, chrome)
  • GitHub Check: Integration Tests (nuxt, chrome)
  • GitHub Check: Integration Tests (localhost, chrome)
  • GitHub Check: Integration Tests (handshake:staging, chrome)
  • GitHub Check: Integration Tests (sessions, chrome)
  • GitHub Check: Integration Tests (express, chrome)
  • GitHub Check: Integration Tests (ap-flows, chrome)
  • GitHub Check: Integration Tests (generic, chrome)
  • GitHub Check: Publish with pkg-pr-new
  • GitHub Check: semgrep-cloud-platform/scan
  • GitHub Check: semgrep-cloud-platform/scan
🔇 Additional comments (1)
.changeset/famous-planes-invent.md (1)

1-12: LGTM!

The changeset is properly formatted with the correct YAML frontmatter. The minor version bump and description accurately reflect the fix to the apiKeys.list() return type. The TypeScript code example is helpful and clearly demonstrates the new pagination structure with data and totalCount properties, aligning with the PaginatedResourceResponse<APIKey[]> type change.


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

@wobsoriano wobsoriano changed the title chore(backend): Remove API keys getSecret method and fix list method type fix(backend): Use paginated type response for API keys list method Nov 5, 2025
@wobsoriano
Copy link
Member Author

!snapshot

@clerk-cookie
Copy link
Collaborator

Hey @wobsoriano - the snapshot version command generated the following package versions:

Package Version
@clerk/agent-toolkit 0.1.47-snapshot.v20251105204110
@clerk/astro 2.14.5-snapshot.v20251105204110
@clerk/backend 2.19.4-snapshot.v20251105204110
@clerk/chrome-extension 2.7.13-snapshot.v20251105204110
@clerk/clerk-js 5.105.0-snapshot.v20251105204110
@clerk/elements 0.23.78-snapshot.v20251105204110
@clerk/clerk-expo 2.18.2-snapshot.v20251105204110
@clerk/expo-passkeys 0.4.15-snapshot.v20251105204110
@clerk/express 1.7.46-snapshot.v20251105204110
@clerk/fastify 2.5.3-snapshot.v20251105204110
@clerk/localizations 3.27.0-snapshot.v20251105204110
@clerk/nextjs 6.34.4-snapshot.v20251105204110
@clerk/nuxt 1.11.5-snapshot.v20251105204110
@clerk/clerk-react 5.53.7-snapshot.v20251105204110
@clerk/react-router 2.1.9-snapshot.v20251105204110
@clerk/remix 4.13.12-snapshot.v20251105204110
@clerk/shared 3.31.1-snapshot.v20251105204110
@clerk/tanstack-react-start 0.26.8-snapshot.v20251105204110
@clerk/testing 1.13.12-snapshot.v20251105204110
@clerk/themes 2.4.33-snapshot.v20251105204110
@clerk/types 4.97.2-snapshot.v20251105204110
@clerk/vue 1.14.12-snapshot.v20251105204110

Tip: Use the snippet copy button below to quickly install the required packages.
@clerk/agent-toolkit

npm i @clerk/agent-toolkit@0.1.47-snapshot.v20251105204110 --save-exact

@clerk/astro

npm i @clerk/astro@2.14.5-snapshot.v20251105204110 --save-exact

@clerk/backend

npm i @clerk/backend@2.19.4-snapshot.v20251105204110 --save-exact

@clerk/chrome-extension

npm i @clerk/chrome-extension@2.7.13-snapshot.v20251105204110 --save-exact

@clerk/clerk-js

npm i @clerk/clerk-js@5.105.0-snapshot.v20251105204110 --save-exact

@clerk/elements

npm i @clerk/elements@0.23.78-snapshot.v20251105204110 --save-exact

@clerk/clerk-expo

npm i @clerk/clerk-expo@2.18.2-snapshot.v20251105204110 --save-exact

@clerk/expo-passkeys

npm i @clerk/expo-passkeys@0.4.15-snapshot.v20251105204110 --save-exact

@clerk/express

npm i @clerk/express@1.7.46-snapshot.v20251105204110 --save-exact

@clerk/fastify

npm i @clerk/fastify@2.5.3-snapshot.v20251105204110 --save-exact

@clerk/localizations

npm i @clerk/localizations@3.27.0-snapshot.v20251105204110 --save-exact

@clerk/nextjs

npm i @clerk/nextjs@6.34.4-snapshot.v20251105204110 --save-exact

@clerk/nuxt

npm i @clerk/nuxt@1.11.5-snapshot.v20251105204110 --save-exact

@clerk/clerk-react

npm i @clerk/clerk-react@5.53.7-snapshot.v20251105204110 --save-exact

@clerk/react-router

npm i @clerk/react-router@2.1.9-snapshot.v20251105204110 --save-exact

@clerk/remix

npm i @clerk/remix@4.13.12-snapshot.v20251105204110 --save-exact

@clerk/shared

npm i @clerk/shared@3.31.1-snapshot.v20251105204110 --save-exact

@clerk/tanstack-react-start

npm i @clerk/tanstack-react-start@0.26.8-snapshot.v20251105204110 --save-exact

@clerk/testing

npm i @clerk/testing@1.13.12-snapshot.v20251105204110 --save-exact

@clerk/themes

npm i @clerk/themes@2.4.33-snapshot.v20251105204110 --save-exact

@clerk/types

npm i @clerk/types@4.97.2-snapshot.v20251105204110 --save-exact

@clerk/vue

npm i @clerk/vue@1.14.12-snapshot.v20251105204110 --save-exact

@pkg-pr-new
Copy link

pkg-pr-new bot commented Nov 5, 2025

Open in StackBlitz

@clerk/agent-toolkit

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

@clerk/astro

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

@clerk/backend

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

@clerk/chrome-extension

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

@clerk/clerk-js

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

@clerk/dev-cli

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

@clerk/elements

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

@clerk/clerk-expo

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

@clerk/expo-passkeys

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

@clerk/express

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

@clerk/fastify

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

@clerk/localizations

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

@clerk/nextjs

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

@clerk/nuxt

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

@clerk/clerk-react

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

@clerk/react-router

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

@clerk/remix

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

@clerk/shared

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

@clerk/tanstack-react-start

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

@clerk/testing

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

@clerk/themes

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

@clerk/types

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

@clerk/upgrade

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

@clerk/vue

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

commit: 88d0d63

@@ -0,0 +1,5 @@
---
"@clerk/backend": minor
Copy link
Member Author

Choose a reason for hiding this comment

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

doing a minor since the data property is introduced in https://github.com/clerk/cloudflare-workers/pull/1378 and it was api_keys before.

api keys still in beta so still just a minor bump

@wobsoriano wobsoriano enabled auto-merge (squash) November 5, 2025 20:54
@blacksmith-sh
Copy link

blacksmith-sh bot commented Nov 5, 2025

Found 1 test failure on Blacksmith runners:

Test View Logs
[chrome] › integration/tests/
session-tasks-multi-session.test.ts:33:9 › session tasks multi-session flow @nextjs › l
ong-running--next.appRouter.withSessionTasks › when switching sessions, navigate to tas
k
View Logs


Fix in Cursor

@wobsoriano wobsoriano merged commit b505755 into main Nov 5, 2025
70 of 73 checks passed
@wobsoriano wobsoriano deleted the rob/user-3879-api-keys-pagination-types branch November 5, 2025 21:06
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

Projects

None yet

Development

Successfully merging this pull request may close these issues.

4 participants