diff --git a/.changeset/famous-planes-invent.md b/.changeset/famous-planes-invent.md new file mode 100644 index 00000000000..22a6377d897 --- /dev/null +++ b/.changeset/famous-planes-invent.md @@ -0,0 +1,12 @@ +--- +"@clerk/backend": minor +--- + +Fixed API keys `list` method return type + +```ts +const apiKeys = await clerkClient.apiKeys.list({ subject: 'user_xxxxx' }) + +apiKeys.data +apiKeys.totalCount +``` diff --git a/packages/backend/src/api/endpoints/APIKeysApi.ts b/packages/backend/src/api/endpoints/APIKeysApi.ts index cc78e803299..89e948060b6 100644 --- a/packages/backend/src/api/endpoints/APIKeysApi.ts +++ b/packages/backend/src/api/endpoints/APIKeysApi.ts @@ -1,5 +1,6 @@ -import type { ClerkPaginationRequest } from '@clerk/types'; +import type { ClerkPaginationRequest } from '@clerk/shared/types'; +import type { PaginatedResourceResponse } from '../../api/resources/Deserializer'; import { joinPaths } from '../../util/path'; import type { APIKey } from '../resources/APIKey'; import { AbstractAPI } from './AbstractApi'; @@ -52,7 +53,7 @@ type RevokeAPIKeyParams = { export class APIKeysAPI extends AbstractAPI { async list(queryParams: GetAPIKeyListParams) { - return this.request({ + return this.request>({ method: 'GET', path: basePath, queryParams,