From 10e724d44f6436f7aadcce96323dd552687c6e9f Mon Sep 17 00:00:00 2001 From: Nikos Douvlis Date: Tue, 2 Sep 2025 13:23:25 +0300 Subject: [PATCH 1/3] refactor(types): Update module resolution and import paths for consistency --- packages/types/src/authConfig.ts | 3 +-- packages/types/src/commerceSettings.ts | 3 +-- packages/types/src/hooks.ts | 5 ++--- packages/types/src/phoneNumber.ts | 3 +-- packages/types/src/signUp.ts | 13 ++++++------- packages/types/src/telemetry.ts | 2 +- packages/types/src/userSettings.ts | 3 +-- packages/types/tsconfig.json | 6 +++--- 8 files changed, 16 insertions(+), 22 deletions(-) diff --git a/packages/types/src/authConfig.ts b/packages/types/src/authConfig.ts index 38d87bb0fe7..3af9b4171c9 100644 --- a/packages/types/src/authConfig.ts +++ b/packages/types/src/authConfig.ts @@ -1,5 +1,4 @@ -import type { PhoneCodeChannel } from 'phoneCodeChannel'; - +import type { PhoneCodeChannel } from './phoneCodeChannel'; import type { ClerkResource } from './resource'; import type { AuthConfigJSONSnapshot } from './snapshots'; diff --git a/packages/types/src/commerceSettings.ts b/packages/types/src/commerceSettings.ts index d41bf633ff9..f14c61b03e4 100644 --- a/packages/types/src/commerceSettings.ts +++ b/packages/types/src/commerceSettings.ts @@ -1,7 +1,6 @@ -import type { CommerceSettingsJSONSnapshot } from 'snapshots'; - import type { ClerkResourceJSON } from './json'; import type { ClerkResource } from './resource'; +import type { CommerceSettingsJSONSnapshot } from './snapshots'; export interface CommerceSettingsJSON extends ClerkResourceJSON { billing: { diff --git a/packages/types/src/hooks.ts b/packages/types/src/hooks.ts index 47fd1f6f017..3da810ffbc2 100644 --- a/packages/types/src/hooks.ts +++ b/packages/types/src/hooks.ts @@ -1,14 +1,13 @@ -import type { OrganizationCustomRoleKey } from 'organizationMembership'; -import type { SignInResource } from 'signIn'; - import type { SetActive, SignOut } from './clerk'; import type { ActClaim, JwtPayload } from './jwtv2'; +import type { OrganizationCustomRoleKey } from './organizationMembership'; import type { CheckAuthorizationWithCustomPermissions, GetToken, SessionResource, SignedInSessionResource, } from './session'; +import type { SignInResource } from './signIn'; import type { SignUpResource } from './signUp'; import type { UserResource } from './user'; diff --git a/packages/types/src/phoneNumber.ts b/packages/types/src/phoneNumber.ts index d30715246b3..c9ff411bf3a 100644 --- a/packages/types/src/phoneNumber.ts +++ b/packages/types/src/phoneNumber.ts @@ -1,6 +1,5 @@ -import type { PhoneCodeChannel } from 'phoneCodeChannel'; - import type { IdentificationLinkResource } from './identificationLink'; +import type { PhoneCodeChannel } from './phoneCodeChannel'; import type { ClerkResource } from './resource'; import type { PhoneNumberJSONSnapshot } from './snapshots'; import type { PhoneCodeStrategy } from './strategies'; diff --git a/packages/types/src/signUp.ts b/packages/types/src/signUp.ts index 14bddd81af2..63976a78fa1 100644 --- a/packages/types/src/signUp.ts +++ b/packages/types/src/signUp.ts @@ -1,3 +1,8 @@ +import type { AttemptEmailAddressVerificationParams, PrepareEmailAddressVerificationParams } from './emailAddress'; +import type { ValidatePasswordCallbacks } from './passwords'; +import type { AttemptPhoneNumberVerificationParams, PreparePhoneNumberVerificationParams } from './phoneNumber'; +import type { AuthenticateWithPopupParams, AuthenticateWithRedirectParams } from './redirects'; +import type { ClerkResource } from './resource'; import type { AttemptVerificationParams, PrepareVerificationParams, @@ -8,13 +13,7 @@ import type { SignUpStatus, SignUpUpdateParams, SignUpVerificationsResource, -} from 'signUpCommon'; - -import type { AttemptEmailAddressVerificationParams, PrepareEmailAddressVerificationParams } from './emailAddress'; -import type { ValidatePasswordCallbacks } from './passwords'; -import type { AttemptPhoneNumberVerificationParams, PreparePhoneNumberVerificationParams } from './phoneNumber'; -import type { AuthenticateWithPopupParams, AuthenticateWithRedirectParams } from './redirects'; -import type { ClerkResource } from './resource'; +} from './signUpCommon'; import type { SignUpFutureResource } from './signUpFuture'; import type { SignUpJSONSnapshot } from './snapshots'; import type { CreateEmailLinkFlowReturn, StartEmailLinkFlowParams } from './verification'; diff --git a/packages/types/src/telemetry.ts b/packages/types/src/telemetry.ts index 0c8c735ebf8..bc518207818 100644 --- a/packages/types/src/telemetry.ts +++ b/packages/types/src/telemetry.ts @@ -1,4 +1,4 @@ -import type { InstanceType } from 'instance'; +import type { InstanceType } from './instance'; type JSONValue = string | number | boolean | null | JSONValue[] | { [key: string]: JSONValue }; diff --git a/packages/types/src/userSettings.ts b/packages/types/src/userSettings.ts index 3b1271a5220..0827f0af0be 100644 --- a/packages/types/src/userSettings.ts +++ b/packages/types/src/userSettings.ts @@ -1,6 +1,5 @@ -import type { PhoneCodeChannel } from 'phoneCodeChannel'; - import type { ClerkResourceJSON } from './json'; +import type { PhoneCodeChannel } from './phoneCodeChannel'; import type { ClerkResource } from './resource'; import type { UserSettingsJSONSnapshot } from './snapshots'; import type { OAuthStrategy, Web3Strategy } from './strategies'; diff --git a/packages/types/tsconfig.json b/packages/types/tsconfig.json index b4cd2de77f2..2dc99c17b81 100644 --- a/packages/types/tsconfig.json +++ b/packages/types/tsconfig.json @@ -1,10 +1,10 @@ { "compilerOptions": { "outDir": "./dist", - "baseUrl": "./src", + "baseUrl": ".", "lib": ["es6", "dom"], - "module": "commonjs", - "moduleResolution": "node", + "module": "NodeNext", + "moduleResolution": "NodeNext", "declaration": true, "declarationMap": true, "noImplicitReturns": true, From ecc926cc54ceeab182416c0753e30aabbeaae4b6 Mon Sep 17 00:00:00 2001 From: Nikos Douvlis Date: Tue, 2 Sep 2025 13:24:10 +0300 Subject: [PATCH 2/3] refactor(types): Move all runtime values to `runtime-values.ts` --- packages/types/src/index.ts | 4 + packages/types/src/oauth.ts | 218 -------------------- packages/types/src/runtime-values.ts | 287 +++++++++++++++++++++++++++ packages/types/src/saml.ts | 19 -- packages/types/src/web3.ts | 49 ----- 5 files changed, 291 insertions(+), 286 deletions(-) create mode 100644 packages/types/src/runtime-values.ts diff --git a/packages/types/src/index.ts b/packages/types/src/index.ts index 7b5448af040..1530db283ca 100644 --- a/packages/types/src/index.ts +++ b/packages/types/src/index.ts @@ -50,6 +50,10 @@ export * from './redirects'; export * from './resource'; export * from './role'; export * from './router'; +/** + * TODO @revamp-hooks: Drop this in the next major release. + */ +export * from './runtime-values'; export * from './saml'; export * from './samlAccount'; export * from './samlConnection'; diff --git a/packages/types/src/oauth.ts b/packages/types/src/oauth.ts index 41c61d270c1..76707e51cff 100644 --- a/packages/types/src/oauth.ts +++ b/packages/types/src/oauth.ts @@ -69,221 +69,3 @@ export type OAuthProvider = | EnstallOauthProvider | HuggingfaceOAuthProvider | CustomOauthProvider; - -/** - * @deprecated Use `import { OAUTH_PROVIDERS } from "@clerk/shared/oauth"` instead. - * - * @hidden - */ -export const OAUTH_PROVIDERS: OAuthProviderData[] = [ - { - provider: 'google', - strategy: 'oauth_google', - name: 'Google', - docsUrl: 'https://clerk.com/docs/authentication/social-connections/google', - }, - { - provider: 'discord', - strategy: 'oauth_discord', - name: 'Discord', - docsUrl: 'https://clerk.com/docs/authentication/social-connections/discord', - }, - { - provider: 'facebook', - strategy: 'oauth_facebook', - name: 'Facebook', - docsUrl: 'https://clerk.com/docs/authentication/social-connections/facebook', - }, - { - provider: 'twitch', - strategy: 'oauth_twitch', - name: 'Twitch', - docsUrl: 'https://clerk.com/docs/authentication/social-connections/twitch', - }, - { - provider: 'twitter', - strategy: 'oauth_twitter', - name: 'Twitter', - docsUrl: 'https://clerk.com/docs/authentication/social-connections/twitter', - }, - { - provider: 'microsoft', - strategy: 'oauth_microsoft', - name: 'Microsoft', - docsUrl: 'https://clerk.com/docs/authentication/social-connections/microsoft', - }, - { - provider: 'tiktok', - strategy: 'oauth_tiktok', - name: 'TikTok', - docsUrl: 'https://clerk.com/docs/authentication/social-connections/tiktok', - }, - { - provider: 'linkedin', - strategy: 'oauth_linkedin', - name: 'LinkedIn', - docsUrl: 'https://clerk.com/docs/authentication/social-connections/linkedin', - }, - { - provider: 'linkedin_oidc', - strategy: 'oauth_linkedin_oidc', - name: 'LinkedIn', - docsUrl: 'https://clerk.com/docs/authentication/social-connections/linkedin-oidc', - }, - { - provider: 'github', - strategy: 'oauth_github', - name: 'GitHub', - docsUrl: 'https://clerk.com/docs/authentication/social-connections/github', - }, - { - provider: 'gitlab', - strategy: 'oauth_gitlab', - name: 'GitLab', - docsUrl: 'https://clerk.com/docs/authentication/social-connections/gitlab', - }, - { - provider: 'dropbox', - strategy: 'oauth_dropbox', - name: 'Dropbox', - docsUrl: 'https://clerk.com/docs/authentication/social-connections/dropbox', - }, - { - provider: 'atlassian', - strategy: 'oauth_atlassian', - name: 'Atlassian', - docsUrl: 'https://clerk.com/docs/authentication/social-connections/atlassian', - }, - { - provider: 'bitbucket', - strategy: 'oauth_bitbucket', - name: 'Bitbucket', - docsUrl: 'https://clerk.com/docs/authentication/social-connections/bitbucket', - }, - { - provider: 'hubspot', - strategy: 'oauth_hubspot', - name: 'HubSpot', - docsUrl: 'https://clerk.com/docs/authentication/social-connections/hubspot', - }, - { - provider: 'notion', - strategy: 'oauth_notion', - name: 'Notion', - docsUrl: 'https://clerk.com/docs/authentication/social-connections/notion', - }, - { - provider: 'apple', - strategy: 'oauth_apple', - name: 'Apple', - docsUrl: 'https://clerk.com/docs/authentication/social-connections/apple', - }, - { - provider: 'line', - strategy: 'oauth_line', - name: 'LINE', - docsUrl: 'https://clerk.com/docs/authentication/social-connections/line', - }, - { - provider: 'instagram', - strategy: 'oauth_instagram', - name: 'Instagram', - docsUrl: 'https://clerk.com/docs/authentication/social-connections/instagram', - }, - { - provider: 'coinbase', - strategy: 'oauth_coinbase', - name: 'Coinbase', - docsUrl: 'https://clerk.com/docs/authentication/social-connections/coinbase', - }, - { - provider: 'spotify', - strategy: 'oauth_spotify', - name: 'Spotify', - docsUrl: 'https://clerk.com/docs/authentication/social-connections/spotify', - }, - { - provider: 'xero', - strategy: 'oauth_xero', - name: 'Xero', - docsUrl: 'https://clerk.com/docs/authentication/social-connections/xero', - }, - { - provider: 'box', - strategy: 'oauth_box', - name: 'Box', - docsUrl: 'https://clerk.com/docs/authentication/social-connections/box', - }, - { - provider: 'slack', - strategy: 'oauth_slack', - name: 'Slack', - docsUrl: 'https://clerk.com/docs/authentication/social-connections/slack', - }, - { - provider: 'linear', - strategy: 'oauth_linear', - name: 'Linear', - docsUrl: 'https://clerk.com/docs/authentication/social-connections/linear', - }, - { - provider: 'x', - strategy: 'oauth_x', - name: 'X / Twitter', - docsUrl: 'https://clerk.com/docs/authentication/social-connections/x-twitter-v2', - }, - { - provider: 'enstall', - strategy: 'oauth_enstall', - name: 'Enstall', - docsUrl: 'https://clerk.com/docs/authentication/social-connections/enstall', - }, - { - provider: 'huggingface', - strategy: 'oauth_huggingface', - name: 'Hugging Face', - docsUrl: 'https://clerk.com/docs/authentication/social-connections/huggingface', - }, -]; - -interface getOAuthProviderDataProps { - provider?: OAuthProvider; - strategy?: OAuthStrategy; -} - -/** - * @deprecated This utility will be dropped in the next major release. - * - * @hidden - */ -export function getOAuthProviderData({ - provider, - strategy, -}: getOAuthProviderDataProps): OAuthProviderData | undefined | null { - if (provider) { - return OAUTH_PROVIDERS.find(oauth_provider => oauth_provider.provider == provider); - } - - return OAUTH_PROVIDERS.find(oauth_provider => oauth_provider.strategy == strategy); -} - -/** - * @deprecated This utility will be dropped in the next major release. - * - * @hidden - */ -export function sortedOAuthProviders(sortingArray: OAuthStrategy[]) { - return OAUTH_PROVIDERS.slice().sort((a, b) => { - let aPos = sortingArray.indexOf(a.strategy); - if (aPos == -1) { - aPos = Number.MAX_SAFE_INTEGER; - } - - let bPos = sortingArray.indexOf(b.strategy); - if (bPos == -1) { - bPos = Number.MAX_SAFE_INTEGER; - } - - return aPos - bPos; - }); -} diff --git a/packages/types/src/runtime-values.ts b/packages/types/src/runtime-values.ts new file mode 100644 index 00000000000..1fa5fc6ce94 --- /dev/null +++ b/packages/types/src/runtime-values.ts @@ -0,0 +1,287 @@ +import type { OAuthProvider, OAuthProviderData } from './oauth'; +import type { SamlIdpMap } from './saml'; +import type { OAuthStrategy, Web3Strategy } from './strategies'; +import type { Web3Provider, Web3ProviderData } from './web3'; + +/** + * @deprecated Use `import { WEB3_PROVIDERS } from "@clerk/shared/web3"` instead. + * + * @hidden + */ +export const WEB3_PROVIDERS: Web3ProviderData[] = [ + { + provider: 'metamask', + strategy: 'web3_metamask_signature', + name: 'MetaMask', + }, + { + provider: 'base', + strategy: 'web3_base_signature', + name: 'Base', + }, + { + provider: 'coinbase_wallet', + strategy: 'web3_coinbase_wallet_signature', + name: 'Coinbase Wallet', + }, + { + provider: 'okx_wallet', + strategy: 'web3_okx_wallet_signature', + name: 'OKX Wallet', + }, +]; + +/** + * @deprecated This utility will be dropped in the next major release. + * + * @hidden + */ +export function getWeb3ProviderData(params: { + provider?: Web3Provider; + strategy?: Web3Strategy; +}): Web3ProviderData | undefined | null { + const { provider, strategy } = params; + if (provider) { + return WEB3_PROVIDERS.find(p => p.provider == provider); + } + + return WEB3_PROVIDERS.find(p => p.strategy == strategy); +} + +/** + * @deprecated Use `import { OAUTH_PROVIDERS } from "@clerk/shared/oauth"` instead. + * + * @hidden + */ +export const OAUTH_PROVIDERS: OAuthProviderData[] = [ + { + provider: 'google', + strategy: 'oauth_google', + name: 'Google', + docsUrl: 'https://clerk.com/docs/authentication/social-connections/google', + }, + { + provider: 'discord', + strategy: 'oauth_discord', + name: 'Discord', + docsUrl: 'https://clerk.com/docs/authentication/social-connections/discord', + }, + { + provider: 'facebook', + strategy: 'oauth_facebook', + name: 'Facebook', + docsUrl: 'https://clerk.com/docs/authentication/social-connections/facebook', + }, + { + provider: 'twitch', + strategy: 'oauth_twitch', + name: 'Twitch', + docsUrl: 'https://clerk.com/docs/authentication/social-connections/twitch', + }, + { + provider: 'twitter', + strategy: 'oauth_twitter', + name: 'Twitter', + docsUrl: 'https://clerk.com/docs/authentication/social-connections/twitter', + }, + { + provider: 'microsoft', + strategy: 'oauth_microsoft', + name: 'Microsoft', + docsUrl: 'https://clerk.com/docs/authentication/social-connections/microsoft', + }, + { + provider: 'tiktok', + strategy: 'oauth_tiktok', + name: 'TikTok', + docsUrl: 'https://clerk.com/docs/authentication/social-connections/tiktok', + }, + { + provider: 'linkedin', + strategy: 'oauth_linkedin', + name: 'LinkedIn', + docsUrl: 'https://clerk.com/docs/authentication/social-connections/linkedin', + }, + { + provider: 'linkedin_oidc', + strategy: 'oauth_linkedin_oidc', + name: 'LinkedIn', + docsUrl: 'https://clerk.com/docs/authentication/social-connections/linkedin-oidc', + }, + { + provider: 'github', + strategy: 'oauth_github', + name: 'GitHub', + docsUrl: 'https://clerk.com/docs/authentication/social-connections/github', + }, + { + provider: 'gitlab', + strategy: 'oauth_gitlab', + name: 'GitLab', + docsUrl: 'https://clerk.com/docs/authentication/social-connections/gitlab', + }, + { + provider: 'dropbox', + strategy: 'oauth_dropbox', + name: 'Dropbox', + docsUrl: 'https://clerk.com/docs/authentication/social-connections/dropbox', + }, + { + provider: 'atlassian', + strategy: 'oauth_atlassian', + name: 'Atlassian', + docsUrl: 'https://clerk.com/docs/authentication/social-connections/atlassian', + }, + { + provider: 'bitbucket', + strategy: 'oauth_bitbucket', + name: 'Bitbucket', + docsUrl: 'https://clerk.com/docs/authentication/social-connections/bitbucket', + }, + { + provider: 'hubspot', + strategy: 'oauth_hubspot', + name: 'HubSpot', + docsUrl: 'https://clerk.com/docs/authentication/social-connections/hubspot', + }, + { + provider: 'notion', + strategy: 'oauth_notion', + name: 'Notion', + docsUrl: 'https://clerk.com/docs/authentication/social-connections/notion', + }, + { + provider: 'apple', + strategy: 'oauth_apple', + name: 'Apple', + docsUrl: 'https://clerk.com/docs/authentication/social-connections/apple', + }, + { + provider: 'line', + strategy: 'oauth_line', + name: 'LINE', + docsUrl: 'https://clerk.com/docs/authentication/social-connections/line', + }, + { + provider: 'instagram', + strategy: 'oauth_instagram', + name: 'Instagram', + docsUrl: 'https://clerk.com/docs/authentication/social-connections/instagram', + }, + { + provider: 'coinbase', + strategy: 'oauth_coinbase', + name: 'Coinbase', + docsUrl: 'https://clerk.com/docs/authentication/social-connections/coinbase', + }, + { + provider: 'spotify', + strategy: 'oauth_spotify', + name: 'Spotify', + docsUrl: 'https://clerk.com/docs/authentication/social-connections/spotify', + }, + { + provider: 'xero', + strategy: 'oauth_xero', + name: 'Xero', + docsUrl: 'https://clerk.com/docs/authentication/social-connections/xero', + }, + { + provider: 'box', + strategy: 'oauth_box', + name: 'Box', + docsUrl: 'https://clerk.com/docs/authentication/social-connections/box', + }, + { + provider: 'slack', + strategy: 'oauth_slack', + name: 'Slack', + docsUrl: 'https://clerk.com/docs/authentication/social-connections/slack', + }, + { + provider: 'linear', + strategy: 'oauth_linear', + name: 'Linear', + docsUrl: 'https://clerk.com/docs/authentication/social-connections/linear', + }, + { + provider: 'x', + strategy: 'oauth_x', + name: 'X / Twitter', + docsUrl: 'https://clerk.com/docs/authentication/social-connections/x-twitter-v2', + }, + { + provider: 'enstall', + strategy: 'oauth_enstall', + name: 'Enstall', + docsUrl: 'https://clerk.com/docs/authentication/social-connections/enstall', + }, + { + provider: 'huggingface', + strategy: 'oauth_huggingface', + name: 'Hugging Face', + docsUrl: 'https://clerk.com/docs/authentication/social-connections/huggingface', + }, +]; + +/** + * @deprecated This utility will be dropped in the next major release. + * + * @hidden + */ +export function getOAuthProviderData(params: { + provider?: OAuthProvider; + strategy?: OAuthStrategy; +}): OAuthProviderData | undefined | null { + const { provider, strategy } = params; + if (provider) { + return OAUTH_PROVIDERS.find(oauth_provider => oauth_provider.provider == provider); + } + + return OAUTH_PROVIDERS.find(oauth_provider => oauth_provider.strategy == strategy); +} + +/** + * @deprecated This utility will be dropped in the next major release. + * + * @hidden + */ +export function sortedOAuthProviders(sortingArray: OAuthStrategy[]) { + return OAUTH_PROVIDERS.slice().sort((a, b) => { + let aPos = sortingArray.indexOf(a.strategy); + if (aPos == -1) { + aPos = Number.MAX_SAFE_INTEGER; + } + + let bPos = sortingArray.indexOf(b.strategy); + if (bPos == -1) { + bPos = Number.MAX_SAFE_INTEGER; + } + + return aPos - bPos; + }); +} + +/** + * @deprecated Use `import { SAML_IDPS } from "@clerk/shared/saml"` instead. + * + * @hidden + */ +export const SAML_IDPS: SamlIdpMap = { + saml_okta: { + name: 'Okta Workforce', + logo: 'okta', + }, + saml_google: { + name: 'Google Workspace', + logo: 'google', + }, + saml_microsoft: { + name: 'Microsoft Entra ID (Formerly AD)', + logo: 'azure', + }, + saml_custom: { + name: 'SAML', + logo: 'saml', + }, +}; diff --git a/packages/types/src/saml.ts b/packages/types/src/saml.ts index c2a3d24774f..72a619dad70 100644 --- a/packages/types/src/saml.ts +++ b/packages/types/src/saml.ts @@ -6,22 +6,3 @@ export type SamlIdp = { }; export type SamlIdpMap = Record; - -export const SAML_IDPS: SamlIdpMap = { - saml_okta: { - name: 'Okta Workforce', - logo: 'okta', - }, - saml_google: { - name: 'Google Workspace', - logo: 'google', - }, - saml_microsoft: { - name: 'Microsoft Entra ID (Formerly AD)', - logo: 'azure', - }, - saml_custom: { - name: 'SAML', - logo: 'saml', - }, -}; diff --git a/packages/types/src/web3.ts b/packages/types/src/web3.ts index fc4249bf9b3..78e82f3fb76 100644 --- a/packages/types/src/web3.ts +++ b/packages/types/src/web3.ts @@ -12,52 +12,3 @@ export type OKXWalletWeb3Provider = 'okx_wallet'; export type BaseWeb3Provider = 'base'; export type Web3Provider = MetamaskWeb3Provider | BaseWeb3Provider | CoinbaseWalletWeb3Provider | OKXWalletWeb3Provider; - -/** - * @deprecated Use `import { WEB3_PROVIDERS } from "@clerk/shared/web3"` instead. - * - * @hidden - */ -export const WEB3_PROVIDERS: Web3ProviderData[] = [ - { - provider: 'metamask', - strategy: 'web3_metamask_signature', - name: 'MetaMask', - }, - { - provider: 'base', - strategy: 'web3_base_signature', - name: 'Base', - }, - { - provider: 'coinbase_wallet', - strategy: 'web3_coinbase_wallet_signature', - name: 'Coinbase Wallet', - }, - { - provider: 'okx_wallet', - strategy: 'web3_okx_wallet_signature', - name: 'OKX Wallet', - }, -]; - -interface getWeb3ProviderDataProps { - provider?: Web3Provider; - strategy?: Web3Strategy; -} - -/** - * @deprecated This utility will be dropped in the next major release. - * - * @hidden - */ -export function getWeb3ProviderData({ - provider, - strategy, -}: getWeb3ProviderDataProps): Web3ProviderData | undefined | null { - if (provider) { - return WEB3_PROVIDERS.find(p => p.provider == provider); - } - - return WEB3_PROVIDERS.find(p => p.strategy == strategy); -} From 034458878696c4412fb076dc855d2e0f44daf8b0 Mon Sep 17 00:00:00 2001 From: Nikos Douvlis Date: Tue, 2 Sep 2025 13:24:43 +0300 Subject: [PATCH 3/3] feat(shared): Export SAML_IDPS from shared/saml --- .changeset/new-deer-attend.md | 8 ++++++++ packages/shared/package.json | 1 + packages/shared/src/saml.ts | 20 ++++++++++++++++++++ 3 files changed, 29 insertions(+) create mode 100644 .changeset/new-deer-attend.md create mode 100644 packages/shared/src/saml.ts diff --git a/.changeset/new-deer-attend.md b/.changeset/new-deer-attend.md new file mode 100644 index 00000000000..57f38641fbf --- /dev/null +++ b/.changeset/new-deer-attend.md @@ -0,0 +1,8 @@ +--- +'@clerk/shared': patch +'@clerk/types': patch +--- + +The `SAML_IDPS` export was moved from `@clerk/types` to `@clerk/shared/saml` and was marked as deprecated. + +Please use `import { SAML_IDPS } from "@clerk/shared/saml"` instead. \ No newline at end of file diff --git a/packages/shared/package.json b/packages/shared/package.json index ba225f6bf63..99504921064 100644 --- a/packages/shared/package.json +++ b/packages/shared/package.json @@ -115,6 +115,7 @@ "object", "oauth", "web3", + "saml", "getEnvVariable", "pathMatcher", "organization", diff --git a/packages/shared/src/saml.ts b/packages/shared/src/saml.ts new file mode 100644 index 00000000000..953006b3bd8 --- /dev/null +++ b/packages/shared/src/saml.ts @@ -0,0 +1,20 @@ +import type { SamlIdpMap } from '@clerk/types'; + +export const SAML_IDPS: SamlIdpMap = { + saml_okta: { + name: 'Okta Workforce', + logo: 'okta', + }, + saml_google: { + name: 'Google Workspace', + logo: 'google', + }, + saml_microsoft: { + name: 'Microsoft Entra ID (Formerly AD)', + logo: 'azure', + }, + saml_custom: { + name: 'SAML', + logo: 'saml', + }, +};