Skip to content

Commit 2c33684

Browse files
committed
feat: promote OAuthConsent to public API across all SDKs
- Rename __internal_OAuthConsentProps to OAuthConsentProps in @clerk/shared - Rename __internal_mountOAuthConsent / __internal_unmountOAuthConsent to mountOAuthConsent / unmountOAuthConsent on the Clerk interface and clerk-js - Add OAuthConsent and useOAuthConsent to the public exports of @clerk/react, @clerk/nextjs, @clerk/vue, @clerk/nuxt, and @clerk/astro - Add @deprecated JSDoc to the existing /internal re-exports in @clerk/react and @clerk/nextjs pointing consumers to the public paths - Update @clerk/ui type references to the renamed public types
1 parent 69dac72 commit 2c33684

24 files changed

Lines changed: 90 additions & 117 deletions

File tree

docs/superpowers/specs/2026-04-14-accounts-oauth-consent-refactor-design.md

Lines changed: 0 additions & 88 deletions
This file was deleted.

packages/astro/src/astro-components/index.ts

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -28,5 +28,6 @@ export { default as OrganizationList } from './interactive/OrganizationList.astr
2828
export { default as CreateOrganization } from './interactive/CreateOrganization.astro';
2929
export { default as GoogleOneTap } from './interactive/GoogleOneTap.astro';
3030
export { default as Waitlist } from './interactive/Waitlist.astro';
31+
export { default as OAuthConsent } from './interactive/OAuthConsent.astro';
3132
export { default as PricingTable } from './interactive/PricingTable.astro';
3233
export { default as APIKeys } from './interactive/APIKeys.astro';
Lines changed: 11 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,11 @@
1+
---
2+
import type { OAuthConsentProps } from '@clerk/shared/types';
3+
type Props = OAuthConsentProps;
4+
5+
import InternalUIComponentRenderer from './InternalUIComponentRenderer.astro';
6+
---
7+
8+
<InternalUIComponentRenderer
9+
{...Astro.props}
10+
component='oauth-consent'
11+
/>

packages/astro/src/internal/mount-clerk-astro-js-components.ts

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -21,6 +21,7 @@ const mountAllClerkAstroJSComponents = () => {
2121
waitlist: 'mountWaitlist',
2222
'pricing-table': 'mountPricingTable',
2323
'api-keys': 'mountAPIKeys',
24+
'oauth-consent': 'mountOAuthConsent',
2425
} as const satisfies Record<InternalUIComponentId, keyof Clerk>;
2526

2627
Object.entries(mountFns).forEach(([category, mountFn]) => {

packages/astro/src/react/uiComponents.tsx

Lines changed: 11 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -1,5 +1,6 @@
11
import type {
22
GoogleOneTapProps,
3+
OAuthConsentProps,
34
OrganizationListProps,
45
OrganizationProfileProps,
56
OrganizationSwitcherProps,
@@ -196,3 +197,13 @@ export const PricingTable = withClerk(({ clerk, ...props }: WithClerkProp<Pricin
196197
/>
197198
);
198199
}, 'PricingTable');
200+
201+
export const OAuthConsent = withClerk(({ clerk, ...props }: WithClerkProp<OAuthConsentProps>) => {
202+
return (
203+
<Portal
204+
mount={clerk?.mountOAuthConsent}
205+
unmount={clerk?.unmountOAuthConsent}
206+
props={props}
207+
/>
208+
);
209+
}, 'OAuthConsent');

packages/astro/src/types.ts

Lines changed: 2 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -119,4 +119,5 @@ export type InternalUIComponentId =
119119
| 'google-one-tap'
120120
| 'waitlist'
121121
| 'pricing-table'
122-
| 'api-keys';
122+
| 'api-keys'
123+
| 'oauth-consent';

packages/clerk-js/sandbox/app.ts

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -475,7 +475,7 @@ void (async () => {
475475
description: scope === 'offline_access' ? null : `Grants access to your ${scope}`,
476476
requires_consent: true,
477477
}));
478-
Clerk.__internal_mountOAuthConsent(
478+
Clerk.mountOAuthConsent(
479479
app,
480480
componentControls.oauthConsent.getProps() ?? {
481481
scopes,

packages/clerk-js/src/core/clerk.ts

Lines changed: 3 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -51,7 +51,7 @@ import type {
5151
__internal_AttemptToEnableEnvironmentSettingResult,
5252
__internal_CheckoutProps,
5353
__internal_EnableOrganizationsPromptProps,
54-
__internal_OAuthConsentProps,
54+
OAuthConsentProps,
5555
__internal_PlanDetailsProps,
5656
__internal_SubscriptionDetailsProps,
5757
__internal_UserVerificationModalProps,
@@ -1335,7 +1335,7 @@ export class Clerk implements ClerkInterface {
13351335
void this.#clerkUI?.then(ui => ui.ensureMounted()).then(controls => controls.unmountComponent({ node }));
13361336
};
13371337

1338-
public __internal_mountOAuthConsent = (node: HTMLDivElement, props?: __internal_OAuthConsentProps) => {
1338+
public mountOAuthConsent = (node: HTMLDivElement, props?: OAuthConsentProps) => {
13391339
if (noUserExists(this)) {
13401340
if (this.#instanceType === 'development') {
13411341
throw new ClerkRuntimeError(warnings.cannotRenderOAuthConsentComponentWhenUserDoesNotExist, {
@@ -1359,7 +1359,7 @@ export class Clerk implements ClerkInterface {
13591359
);
13601360
};
13611361

1362-
public __internal_unmountOAuthConsent = (node: HTMLDivElement) => {
1362+
public unmountOAuthConsent = (node: HTMLDivElement) => {
13631363
void this.#clerkUI?.then(ui => ui.ensureMounted()).then(controls => controls.unmountComponent({ node }));
13641364
};
13651365

packages/nextjs/src/client-boundary/hooks.ts

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -4,6 +4,7 @@ export {
44
useAuth,
55
useClerk,
66
useEmailLink,
7+
useOAuthConsent,
78
useOrganization,
89
useOrganizationList,
910
useOrganizationCreationDefaults,

packages/nextjs/src/client-boundary/uiComponents.tsx

Lines changed: 2 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -15,6 +15,8 @@ export {
1515
APIKeys,
1616
CreateOrganization,
1717
GoogleOneTap,
18+
HandleSSOCallback,
19+
OAuthConsent,
1820
OrganizationList,
1921
OrganizationSwitcher,
2022
PricingTable,
@@ -28,11 +30,8 @@ export {
2830
UserAvatar,
2931
UserButton,
3032
Waitlist,
31-
HandleSSOCallback,
3233
} from '@clerk/react';
3334

34-
export { OAuthConsent } from '@clerk/react/internal';
35-
3635
// The assignment of UserProfile with BaseUserProfile props is used
3736
// to support the CustomPage functionality (eg UserProfile.Page)
3837
// Also the `typeof BaseUserProfile` is used to resolve the following error:

0 commit comments

Comments
 (0)