From 7e385fe6b17da88b04160d9b75336dd66d3463d1 Mon Sep 17 00:00:00 2001 From: Sarah Soutoul Date: Tue, 17 Feb 2026 17:24:15 -0600 Subject: [PATCH 1/3] Add JSdocs to APIKey backend --- packages/backend/src/api/resources/APIKey.ts | 51 ++++++++++++++++++++ 1 file changed, 51 insertions(+) diff --git a/packages/backend/src/api/resources/APIKey.ts b/packages/backend/src/api/resources/APIKey.ts index d6d2870e75b..dcad6565be5 100644 --- a/packages/backend/src/api/resources/APIKey.ts +++ b/packages/backend/src/api/resources/APIKey.ts @@ -1,22 +1,73 @@ import type { APIKeyJSON } from './JSON'; +/** + * The Backend `APIKey` object holds information about an API key. + */ export class APIKey { constructor( + /** + * A unique ID for the api key. + */ readonly id: string, + /** + * The type of the API key. Currently always `'api_key'`. + */ readonly type: string, + /** + * The API key's name. + */ readonly name: string, + /** + * The user or organization ID that the API key is associated with. + */ readonly subject: string, + /** + * An array of scopes that define what the API key can access. + */ readonly scopes: string[], + /** + * Custom claims associated with the API key. + */ readonly claims: Record | null, + /** + * A boolean indicating whether the API key has been revoked. + */ readonly revoked: boolean, + /** + * The reason for revoking the API key, if it has been revoked. + */ readonly revocationReason: string | null, + /** + * A boolean indicating whether the API key has expired. + */ readonly expired: boolean, + /** + * The expiration date and time of the API key. `null` if the API key never expires. + */ readonly expiration: number | null, + /** + * The user ID for the user creating the API key. + */ readonly createdBy: string | null, + /** + * An optional description for the API key. + */ readonly description: string | null, + /** + * The date and time when the API key was last used to authenticate a request. + */ readonly lastUsedAt: number | null, + /** + * The date when the API key was created. + */ readonly createdAt: number, + /** + * The date when the API key was last updated. + */ readonly updatedAt: number, + /** + * The API key secret. **This property is only present in the response from [`create()`](/docs/reference/javascript/api-keys#create) and cannot be retrieved later.** + */ readonly secret?: string, ) {} From 7c1cf86908a5d5fbb59d7d252c9b2a8c26ce2211 Mon Sep 17 00:00:00 2001 From: Sarah Soutoul Date: Wed, 18 Feb 2026 10:23:43 -0600 Subject: [PATCH 2/3] Add changeset --- .changeset/pretty-ends-deny.md | 2 ++ 1 file changed, 2 insertions(+) create mode 100644 .changeset/pretty-ends-deny.md diff --git a/.changeset/pretty-ends-deny.md b/.changeset/pretty-ends-deny.md new file mode 100644 index 00000000000..a845151cc84 --- /dev/null +++ b/.changeset/pretty-ends-deny.md @@ -0,0 +1,2 @@ +--- +--- From 22b788e8d635a6b85b5ce6de6a56bb9b121e71d0 Mon Sep 17 00:00:00 2001 From: Sarah Soutoul Date: Wed, 18 Feb 2026 10:54:43 -0600 Subject: [PATCH 3/3] Update packages/backend/src/api/resources/APIKey.ts Co-authored-by: Robert Soriano --- packages/backend/src/api/resources/APIKey.ts | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/packages/backend/src/api/resources/APIKey.ts b/packages/backend/src/api/resources/APIKey.ts index dcad6565be5..ef4e44bf262 100644 --- a/packages/backend/src/api/resources/APIKey.ts +++ b/packages/backend/src/api/resources/APIKey.ts @@ -6,7 +6,7 @@ import type { APIKeyJSON } from './JSON'; export class APIKey { constructor( /** - * A unique ID for the api key. + * A unique ID for the API key. */ readonly id: string, /**