Skip to content
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
12 changes: 12 additions & 0 deletions .changeset/famous-planes-invent.md
Original file line number Diff line number Diff line change
@@ -0,0 +1,12 @@
---
"@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

---

Fixed API keys `list` method return type

```ts
const apiKeys = await clerkClient.apiKeys.list({ subject: 'user_xxxxx' })

apiKeys.data
apiKeys.totalCount
```
5 changes: 3 additions & 2 deletions packages/backend/src/api/endpoints/APIKeysApi.ts
Original file line number Diff line number Diff line change
@@ -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';
Expand Down Expand Up @@ -52,7 +53,7 @@ type RevokeAPIKeyParams = {

export class APIKeysAPI extends AbstractAPI {
async list(queryParams: GetAPIKeyListParams) {
return this.request<APIKey[]>({
return this.request<PaginatedResourceResponse<APIKey[]>>({
method: 'GET',
path: basePath,
queryParams,
Expand Down
Loading