File tree Expand file tree Collapse file tree 2 files changed +29
-1
lines changed
packages/backend/src/api/endpoints Expand file tree Collapse file tree 2 files changed +29
-1
lines changed Original file line number Diff line number Diff line change 1+ ---
2+ " @clerk/backend " : patch
3+ ---
4+
5+ Added API keys list method to the backend SDK client
Original file line number Diff line number Diff line change 1+ import type { ClerkPaginationRequest } from '@clerk/types' ;
2+
13import { joinPaths } from '../../util/path' ;
24import type { APIKey } from '../resources/APIKey' ;
35import { AbstractAPI } from './AbstractApi' ;
46
57const basePath = '/api_keys' ;
68
9+ type GetAPIKeyListParams = ClerkPaginationRequest < {
10+ /**
11+ * The user or organization ID to query API keys by
12+ */
13+ subject : string ;
14+ /**
15+ * Whether to include invalid API keys.
16+ *
17+ * @default false
18+ */
19+ includeInvalid ?: boolean ;
20+ } > ;
21+
722type CreateAPIKeyParams = {
823 type ?: 'api_key' ;
924 /**
1025 * API key name
1126 */
1227 name : string ;
1328 /**
14- * user or organization ID the API key is associated with
29+ * The user or organization ID to associate the API key with
1530 */
1631 subject : string ;
1732 /**
@@ -36,6 +51,14 @@ type RevokeAPIKeyParams = {
3651} ;
3752
3853export class APIKeysAPI extends AbstractAPI {
54+ async list ( queryParams : GetAPIKeyListParams ) {
55+ return this . request < APIKey [ ] > ( {
56+ method : 'GET' ,
57+ path : basePath ,
58+ queryParams,
59+ } ) ;
60+ }
61+
3962 async create ( params : CreateAPIKeyParams ) {
4063 return this . request < APIKey > ( {
4164 method : 'POST' ,
You can’t perform that action at this time.
0 commit comments