From ac42c393d555155c38ff3ec7465db0c17efa13a9 Mon Sep 17 00:00:00 2001 From: Sarah Soutoul Date: Tue, 5 May 2026 10:58:30 -0600 Subject: [PATCH 01/12] Add enterpriseconnection and enterpriseoauthconfig and enterpriseconnectionsamlconnection --- .typedoc/custom-plugin.mjs | 6 ++++++ packages/backend/src/api/resources/EnterpriseAccount.ts | 2 +- packages/backend/src/api/resources/EnterpriseConnection.ts | 3 +++ 3 files changed, 10 insertions(+), 1 deletion(-) diff --git a/.typedoc/custom-plugin.mjs b/.typedoc/custom-plugin.mjs index cfe5e8c2c85..1bad552ada1 100644 --- a/.typedoc/custom-plugin.mjs +++ b/.typedoc/custom-plugin.mjs @@ -76,6 +76,12 @@ const LINK_REPLACEMENTS = [ ['email-address', '/docs/reference/backend/types/backend-email-address'], ['enterprise-account', '/docs/reference/backend/types/backend-enterprise-account'], ['enterprise-account-connection', '/docs/reference/backend/types/backend-enterprise-account-connection'], + ['enterprise-connection', '/docs/reference/backend/types/backend-enterprise-connection'], + ['enterprise-connection-oauth-config', '/docs/reference/backend/types/backend-enterprise-connection-oauth-config'], + [ + 'enterprise-connection-saml-connection', + '/docs/reference/backend/types/backend-enterprise-connection-saml-connection', + ], ['external-account', '/docs/reference/backend/types/backend-external-account'], ['phone-number', '/docs/reference/backend/types/backend-phone-number'], ['saml-account', '/docs/reference/backend/types/backend-saml-account'], diff --git a/packages/backend/src/api/resources/EnterpriseAccount.ts b/packages/backend/src/api/resources/EnterpriseAccount.ts index d20e52c9d0d..06608da84b4 100644 --- a/packages/backend/src/api/resources/EnterpriseAccount.ts +++ b/packages/backend/src/api/resources/EnterpriseAccount.ts @@ -2,7 +2,7 @@ import type { EnterpriseAccountConnectionJSON, EnterpriseAccountJSON } from './J import { Verification } from './Verification'; /** - * Represents an enterprise SSO connection associated with an enterprise account. + * The Backend `EnterpriseAccountConnection` object represents an enterprise SSO connection associated with an enterprise account. */ export class EnterpriseAccountConnection { constructor( diff --git a/packages/backend/src/api/resources/EnterpriseConnection.ts b/packages/backend/src/api/resources/EnterpriseConnection.ts index 03bfeb50a82..9a63afa49e4 100644 --- a/packages/backend/src/api/resources/EnterpriseConnection.ts +++ b/packages/backend/src/api/resources/EnterpriseConnection.ts @@ -4,6 +4,9 @@ import type { EnterpriseConnectionSamlConnectionJSON, } from './JSON'; +/** + * The Backend `EnterpriseConnectionSamlConnection` object holds information about a SAML enterprise connection for an instance or organization. + */ export class EnterpriseConnectionSamlConnection { constructor( /** From 1327d5a23e66fcfe1e39e17d3c6807e50bbef41e Mon Sep 17 00:00:00 2001 From: wobsoriano Date: Tue, 5 May 2026 10:09:08 -0700 Subject: [PATCH 02/12] chore(shared): Remove internal tag from OAuthConsent types --- packages/shared/src/react/hooks/useOAuthConsent.types.ts | 4 ---- 1 file changed, 4 deletions(-) diff --git a/packages/shared/src/react/hooks/useOAuthConsent.types.ts b/packages/shared/src/react/hooks/useOAuthConsent.types.ts index c8972cd483b..8b61d9ed280 100644 --- a/packages/shared/src/react/hooks/useOAuthConsent.types.ts +++ b/packages/shared/src/react/hooks/useOAuthConsent.types.ts @@ -7,8 +7,6 @@ import type { GetOAuthConsentInfoParams, OAuthConsentInfo } from '../../types'; * Pass `oauthClientId` and `scope` explicitly. The hook does not read from `window.location` or * any other ambient source. The hook is disabled when `oauthClientId` is empty or omitted. * - * @internal - * * @interface */ export type UseOAuthConsentParams = Partial> & { @@ -27,8 +25,6 @@ export type UseOAuthConsentParams = Partial Date: Tue, 5 May 2026 12:23:53 -0600 Subject: [PATCH 03/12] Remove --- .typedoc/custom-plugin.mjs | 4 ---- 1 file changed, 4 deletions(-) diff --git a/.typedoc/custom-plugin.mjs b/.typedoc/custom-plugin.mjs index 1bad552ada1..3deeea815a0 100644 --- a/.typedoc/custom-plugin.mjs +++ b/.typedoc/custom-plugin.mjs @@ -78,10 +78,6 @@ const LINK_REPLACEMENTS = [ ['enterprise-account-connection', '/docs/reference/backend/types/backend-enterprise-account-connection'], ['enterprise-connection', '/docs/reference/backend/types/backend-enterprise-connection'], ['enterprise-connection-oauth-config', '/docs/reference/backend/types/backend-enterprise-connection-oauth-config'], - [ - 'enterprise-connection-saml-connection', - '/docs/reference/backend/types/backend-enterprise-connection-saml-connection', - ], ['external-account', '/docs/reference/backend/types/backend-external-account'], ['phone-number', '/docs/reference/backend/types/backend-phone-number'], ['saml-account', '/docs/reference/backend/types/backend-saml-account'], From a1330a60863a9fcbaa8013562d724dd9e7c1da4b Mon Sep 17 00:00:00 2001 From: Sarah Soutoul Date: Tue, 5 May 2026 12:24:17 -0600 Subject: [PATCH 04/12] Add --- .typedoc/custom-plugin.mjs | 4 ++++ 1 file changed, 4 insertions(+) diff --git a/.typedoc/custom-plugin.mjs b/.typedoc/custom-plugin.mjs index 3deeea815a0..1bad552ada1 100644 --- a/.typedoc/custom-plugin.mjs +++ b/.typedoc/custom-plugin.mjs @@ -78,6 +78,10 @@ const LINK_REPLACEMENTS = [ ['enterprise-account-connection', '/docs/reference/backend/types/backend-enterprise-account-connection'], ['enterprise-connection', '/docs/reference/backend/types/backend-enterprise-connection'], ['enterprise-connection-oauth-config', '/docs/reference/backend/types/backend-enterprise-connection-oauth-config'], + [ + 'enterprise-connection-saml-connection', + '/docs/reference/backend/types/backend-enterprise-connection-saml-connection', + ], ['external-account', '/docs/reference/backend/types/backend-external-account'], ['phone-number', '/docs/reference/backend/types/backend-phone-number'], ['saml-account', '/docs/reference/backend/types/backend-saml-account'], From 708e920067ac55478cae163d40c3c70bf2f8941a Mon Sep 17 00:00:00 2001 From: Sarah Soutoul Date: Tue, 5 May 2026 12:29:13 -0600 Subject: [PATCH 05/12] Add --- .typedoc/custom-plugin.mjs | 5 +---- 1 file changed, 1 insertion(+), 4 deletions(-) diff --git a/.typedoc/custom-plugin.mjs b/.typedoc/custom-plugin.mjs index 1bad552ada1..b7b1fcc62e4 100644 --- a/.typedoc/custom-plugin.mjs +++ b/.typedoc/custom-plugin.mjs @@ -78,10 +78,7 @@ const LINK_REPLACEMENTS = [ ['enterprise-account-connection', '/docs/reference/backend/types/backend-enterprise-account-connection'], ['enterprise-connection', '/docs/reference/backend/types/backend-enterprise-connection'], ['enterprise-connection-oauth-config', '/docs/reference/backend/types/backend-enterprise-connection-oauth-config'], - [ - 'enterprise-connection-saml-connection', - '/docs/reference/backend/types/backend-enterprise-connection-saml-connection', - ], + ['enterprise-connection-saml-connection', '/docs/reference/backend/types/backend-enterprise-connection-saml-connection'], ['external-account', '/docs/reference/backend/types/backend-external-account'], ['phone-number', '/docs/reference/backend/types/backend-phone-number'], ['saml-account', '/docs/reference/backend/types/backend-saml-account'], From 50c858f146369d0105ede1d3b40cf7f0d8da6d86 Mon Sep 17 00:00:00 2001 From: wobsoriano Date: Tue, 5 May 2026 12:44:33 -0700 Subject: [PATCH 06/12] chore: fix hook types and document consent info properties --- .../src/react/hooks/useOAuthConsent.types.ts | 2 +- packages/shared/src/types/oauthApplication.ts | 18 ++++++++++++++++++ 2 files changed, 19 insertions(+), 1 deletion(-) diff --git a/packages/shared/src/react/hooks/useOAuthConsent.types.ts b/packages/shared/src/react/hooks/useOAuthConsent.types.ts index 8b61d9ed280..30548c53bd9 100644 --- a/packages/shared/src/react/hooks/useOAuthConsent.types.ts +++ b/packages/shared/src/react/hooks/useOAuthConsent.types.ts @@ -9,7 +9,7 @@ import type { GetOAuthConsentInfoParams, OAuthConsentInfo } from '../../types'; * * @interface */ -export type UseOAuthConsentParams = Partial> & { +export type UseOAuthConsentParams = Pick & { /** * If `true`, the previous data will be kept in the cache until new data is fetched. * diff --git a/packages/shared/src/types/oauthApplication.ts b/packages/shared/src/types/oauthApplication.ts index c355cfd0dc7..dee2dc58fb4 100644 --- a/packages/shared/src/types/oauthApplication.ts +++ b/packages/shared/src/types/oauthApplication.ts @@ -36,11 +36,29 @@ export type OAuthConsentScope = { * Includes information needed to populate the consent dialog. */ export type OAuthConsentInfo = { + /** + * Display name of the OAuth application requesting access. + */ oauthApplicationName: string; + /** + * URL of the OAuth application's logo image. + */ oauthApplicationLogoUrl: string; + /** + * Homepage URL of the OAuth application. + */ oauthApplicationUrl: string; + /** + * The OAuth `client_id` identifying the application. + */ clientId: string; + /** + * The `state` parameter from the original authorize request. + */ state: string; + /** + * List of scopes the application is requesting, with descriptions and consent requirements. + */ scopes: OAuthConsentScope[]; }; From 4afcb10ae788a121bca86dca7f9c0380b00f10a0 Mon Sep 17 00:00:00 2001 From: wobsoriano Date: Tue, 5 May 2026 12:55:57 -0700 Subject: [PATCH 07/12] chore: clean up oauth consent hook doc and fix default param --- packages/shared/src/react/hooks/useOAuthConsent.tsx | 6 +----- 1 file changed, 1 insertion(+), 5 deletions(-) diff --git a/packages/shared/src/react/hooks/useOAuthConsent.tsx b/packages/shared/src/react/hooks/useOAuthConsent.tsx index b35da37dfd4..6f038058241 100644 --- a/packages/shared/src/react/hooks/useOAuthConsent.tsx +++ b/packages/shared/src/react/hooks/useOAuthConsent.tsx @@ -14,10 +14,6 @@ const HOOK_NAME = 'useOAuthConsent'; * (`GET /me/oauth/consent/{oauthClientId}`). Ensure the user is authenticated before relying on this hook * (for example, redirect to sign-in on your custom consent route). * - * The hook is a pure data fetcher: it takes an explicit `oauthClientId` and optional `scope` and - * issues the fetch when both the user is signed in and `oauthClientId` is non-empty. The query is - * disabled when `oauthClientId` is empty or omitted. - * * @internal * * @example @@ -30,7 +26,7 @@ const HOOK_NAME = 'useOAuthConsent'; * }) * ``` */ -export function useOAuthConsent(params: UseOAuthConsentParams = {}): UseOAuthConsentReturn { +export function useOAuthConsent(params: UseOAuthConsentParams): UseOAuthConsentReturn { useAssertWrappedByClerkProvider(HOOK_NAME); const { oauthClientId: oauthClientIdParam, scope, keepPreviousData = true, enabled = true } = params; From 34e992448f1073cc946a73a15c8c9414b9d55e3b Mon Sep 17 00:00:00 2001 From: wobsoriano Date: Tue, 5 May 2026 12:57:08 -0700 Subject: [PATCH 08/12] chore: remove internal tag from hook --- packages/shared/src/react/hooks/useOAuthConsent.tsx | 2 -- 1 file changed, 2 deletions(-) diff --git a/packages/shared/src/react/hooks/useOAuthConsent.tsx b/packages/shared/src/react/hooks/useOAuthConsent.tsx index 6f038058241..674654a8bea 100644 --- a/packages/shared/src/react/hooks/useOAuthConsent.tsx +++ b/packages/shared/src/react/hooks/useOAuthConsent.tsx @@ -14,8 +14,6 @@ const HOOK_NAME = 'useOAuthConsent'; * (`GET /me/oauth/consent/{oauthClientId}`). Ensure the user is authenticated before relying on this hook * (for example, redirect to sign-in on your custom consent route). * - * @internal - * * @example * ```tsx * import { useOAuthConsent } from '@clerk/react/internal' From afe27241984cee7a85a11d1f8a5043f6d46c3b86 Mon Sep 17 00:00:00 2001 From: Sarah Soutoul Date: Tue, 5 May 2026 14:42:47 -0600 Subject: [PATCH 09/12] Add JSdoc comments --- .typedoc/custom-plugin.mjs | 14 ++++++++++++- .../src/react/hooks/useOAuthConsent.types.ts | 8 +------- packages/shared/src/types/oauthApplication.ts | 20 +++++++++++++++---- 3 files changed, 30 insertions(+), 12 deletions(-) diff --git a/.typedoc/custom-plugin.mjs b/.typedoc/custom-plugin.mjs index b7b1fcc62e4..245a916fb04 100644 --- a/.typedoc/custom-plugin.mjs +++ b/.typedoc/custom-plugin.mjs @@ -36,6 +36,8 @@ const FILES_WITHOUT_HEADINGS = [ 'payment-element-props.mdx', 'use-organization-creation-defaults-return.mdx', 'use-organization-creation-defaults-params.mdx', + 'use-o-auth-consent-params.mdx', + 'use-o-auth-consent-return.mdx', ]; /** @@ -66,6 +68,8 @@ const LINK_REPLACEMENTS = [ ['organization-domain-resource', '/docs/reference/types/organization-domain-resource'], ['organization-invitation-resource', '/docs/reference/types/organization-invitation'], ['organization-membership-request-resource', '/docs/reference/types/organization-membership-request'], + ['o-auth-consent-info', '/docs/reference/types/oauth-consent-info'], + ['o-auth-consent-scope', '/docs/reference/types/oauth-consent-scope'], ['session', '/docs/reference/backend/types/backend-session'], ['session-activity', '/docs/reference/backend/types/backend-session-activity'], ['organization', '/docs/reference/backend/types/backend-organization'], @@ -78,7 +82,10 @@ const LINK_REPLACEMENTS = [ ['enterprise-account-connection', '/docs/reference/backend/types/backend-enterprise-account-connection'], ['enterprise-connection', '/docs/reference/backend/types/backend-enterprise-connection'], ['enterprise-connection-oauth-config', '/docs/reference/backend/types/backend-enterprise-connection-oauth-config'], - ['enterprise-connection-saml-connection', '/docs/reference/backend/types/backend-enterprise-connection-saml-connection'], + [ + 'enterprise-connection-saml-connection', + '/docs/reference/backend/types/backend-enterprise-connection-saml-connection', + ], ['external-account', '/docs/reference/backend/types/backend-external-account'], ['phone-number', '/docs/reference/backend/types/backend-phone-number'], ['saml-account', '/docs/reference/backend/types/backend-saml-account'], @@ -104,6 +111,7 @@ const LINK_REPLACEMENTS = [ ['billing-statement-resource', '/docs/reference/types/billing-statement-resource'], ['billing-subscription-resource', '/docs/reference/types/billing-subscription-resource'], ['clerk-api-response-error', '/docs/reference/types/clerk-api-response-error'], + ['clerk-api-error', '/docs/reference/types/clerk-api-error'], ['billing-statement-totals', '/docs/reference/types/billing-statement-totals'], ['billing-payment-resource', '/docs/reference/types/billing-payment-resource'], ['deleted-object-resource', '/docs/reference/types/deleted-object-resource'], @@ -137,6 +145,10 @@ function getRelativeLinkReplacements() { function getCatchAllReplacements() { return [ + { + pattern: /(?/g, replace: '[`Appearance`](/docs/guides/customizing-clerk/appearance-prop/overview)', diff --git a/packages/shared/src/react/hooks/useOAuthConsent.types.ts b/packages/shared/src/react/hooks/useOAuthConsent.types.ts index 30548c53bd9..8fde2f44516 100644 --- a/packages/shared/src/react/hooks/useOAuthConsent.types.ts +++ b/packages/shared/src/react/hooks/useOAuthConsent.types.ts @@ -2,11 +2,6 @@ import type { ClerkAPIResponseError } from '../../errors/clerkApiResponseError'; import type { GetOAuthConsentInfoParams, OAuthConsentInfo } from '../../types'; /** - * Options for {@link useOAuthConsent}. - * - * Pass `oauthClientId` and `scope` explicitly. The hook does not read from `window.location` or - * any other ambient source. The hook is disabled when `oauthClientId` is empty or omitted. - * * @interface */ export type UseOAuthConsentParams = Pick & { @@ -29,8 +24,7 @@ export type UseOAuthConsentParams = Pick Date: Tue, 5 May 2026 15:36:39 -0600 Subject: [PATCH 10/12] Fix format --- .typedoc/custom-plugin.mjs | 5 +---- 1 file changed, 1 insertion(+), 4 deletions(-) diff --git a/.typedoc/custom-plugin.mjs b/.typedoc/custom-plugin.mjs index 245a916fb04..e7132279b63 100644 --- a/.typedoc/custom-plugin.mjs +++ b/.typedoc/custom-plugin.mjs @@ -82,10 +82,7 @@ const LINK_REPLACEMENTS = [ ['enterprise-account-connection', '/docs/reference/backend/types/backend-enterprise-account-connection'], ['enterprise-connection', '/docs/reference/backend/types/backend-enterprise-connection'], ['enterprise-connection-oauth-config', '/docs/reference/backend/types/backend-enterprise-connection-oauth-config'], - [ - 'enterprise-connection-saml-connection', - '/docs/reference/backend/types/backend-enterprise-connection-saml-connection', - ], + ['enterprise-connection-saml-connection', '/docs/reference/backend/types/backend-enterprise-connection-saml-connection'], ['external-account', '/docs/reference/backend/types/backend-external-account'], ['phone-number', '/docs/reference/backend/types/backend-phone-number'], ['saml-account', '/docs/reference/backend/types/backend-saml-account'], From 1e2768919a6dab9701b30b3da5d91ed38092f471 Mon Sep 17 00:00:00 2001 From: Robert Soriano Date: Tue, 5 May 2026 14:44:34 -0700 Subject: [PATCH 11/12] chore: add changeset --- .changeset/dry-mice-begin.md | 6 ++++++ 1 file changed, 6 insertions(+) create mode 100644 .changeset/dry-mice-begin.md diff --git a/.changeset/dry-mice-begin.md b/.changeset/dry-mice-begin.md new file mode 100644 index 00000000000..23bd3d23eb0 --- /dev/null +++ b/.changeset/dry-mice-begin.md @@ -0,0 +1,6 @@ +--- +"@clerk/backend": patch +"@clerk/shared": patch +--- + +Fix OAuth consent component and hook related types. From 6671fb176d8610adfa4502471c2f9c2c7199fe2f Mon Sep 17 00:00:00 2001 From: Sarah Soutoul Date: Wed, 6 May 2026 15:19:57 -0600 Subject: [PATCH 12/12] Apply suggestions from code review Co-authored-by: Alexis Aguilar <98043211+alexisintech@users.noreply.github.com> --- packages/shared/src/types/oauthApplication.ts | 8 ++++---- 1 file changed, 4 insertions(+), 4 deletions(-) diff --git a/packages/shared/src/types/oauthApplication.ts b/packages/shared/src/types/oauthApplication.ts index cf4927cd111..7bb270e38ce 100644 --- a/packages/shared/src/types/oauthApplication.ts +++ b/packages/shared/src/types/oauthApplication.ts @@ -49,15 +49,15 @@ export type OAuthConsentScope = { */ export type OAuthConsentInfo = { /** - * Display name of the OAuth application requesting access. + * The display name of the OAuth application requesting access. */ oauthApplicationName: string; /** - * URL of the OAuth application's logo image. + * The URL of the OAuth application's logo image. */ oauthApplicationLogoUrl: string; /** - * Homepage URL of the OAuth application. + * The homepage URL of the OAuth application. */ oauthApplicationUrl: string; /** @@ -69,7 +69,7 @@ export type OAuthConsentInfo = { */ state: string; /** - * List of scopes the application is requesting, with descriptions and consent requirements. + * A list of scopes the application is requesting, with descriptions and consent requirements. */ scopes: OAuthConsentScope[]; };