@privy-io/react-auth 2.7.2 → 2.8.0-beta-20250331230509

This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
Files changed (40) hide show
  1. package/dist/cjs/abstract-smart-wallets.js +1 -1
  2. package/dist/cjs/farcaster.js +1 -1
  3. package/dist/cjs/{frame-DIECoMyK.js → frame-BE5iw8D5.js} +1 -1
  4. package/dist/cjs/index.js +1 -1
  5. package/dist/cjs/internal-context-GxD_jR-e.js +1 -0
  6. package/dist/cjs/{privy-provider-CRh83ztH.js → privy-provider-JEGIUWlD.js} +12 -12
  7. package/dist/cjs/{smart-wallets-DTEjSVDG.js → smart-wallets-DI3-QbIO.js} +1 -1
  8. package/dist/cjs/smart-wallets.js +1 -1
  9. package/dist/cjs/solana.js +1 -1
  10. package/dist/cjs/ui.js +1 -1
  11. package/dist/cjs/{useActiveWallet-w-uaXTaQ.js → useActiveWallet-DtqTu2r4.js} +1 -1
  12. package/dist/cjs/{useFundWallet-Be6Xcbzi.js → useFundWallet-BlYO9PlG.js} +1 -1
  13. package/dist/dts/farcaster.d.mts +1 -1
  14. package/dist/dts/farcaster.d.ts +1 -1
  15. package/dist/dts/index.d.mts +138 -5
  16. package/dist/dts/index.d.ts +138 -5
  17. package/dist/dts/smart-wallets.d.mts +1 -1
  18. package/dist/dts/smart-wallets.d.ts +1 -1
  19. package/dist/dts/solana.d.mts +4 -4
  20. package/dist/dts/solana.d.ts +4 -4
  21. package/dist/dts/{types-Cq3xKsys.d.mts → types-B92M8x5e.d.mts} +7 -13
  22. package/dist/dts/{types-Cq3xKsys.d.ts → types-B92M8x5e.d.ts} +7 -13
  23. package/dist/dts/ui.d.mts +1 -1
  24. package/dist/dts/ui.d.ts +1 -1
  25. package/dist/dts/{useSolanaWallets-BADh6ZyK.d.mts → useSolanaWallets-BSNPWBSM.d.mts} +1 -1
  26. package/dist/dts/{useSolanaWallets-BADh6ZyK.d.ts → useSolanaWallets-BSNPWBSM.d.ts} +1 -1
  27. package/dist/esm/abstract-smart-wallets.mjs +1 -1
  28. package/dist/esm/farcaster.mjs +1 -1
  29. package/dist/esm/{frame-Df-urdO7.mjs → frame-DTkUHpPA.mjs} +1 -1
  30. package/dist/esm/index.mjs +1 -1
  31. package/dist/esm/{internal-context-VSJVgTzy.mjs → internal-context-D5bEplez.mjs} +1 -1
  32. package/dist/esm/{privy-provider-Bdp7T8ta.mjs → privy-provider-DOHpmLGb.mjs} +23 -23
  33. package/dist/esm/{smart-wallets-BpSOJT8g.mjs → smart-wallets-CHnU6KSq.mjs} +1 -1
  34. package/dist/esm/smart-wallets.mjs +1 -1
  35. package/dist/esm/solana.mjs +1 -1
  36. package/dist/esm/ui.mjs +1 -1
  37. package/dist/esm/{useActiveWallet-BNKxAK-E.mjs → useActiveWallet-Zs6bXLcN.mjs} +1 -1
  38. package/dist/esm/{useFundWallet-BZzm1dvU.mjs → useFundWallet-BTX04CIm.mjs} +1 -1
  39. package/package.json +3 -3
  40. package/dist/cjs/internal-context-Z2Asu_e_.js +0 -1
@@ -1,7 +1,7 @@
1
1
  import * as react from 'react';
2
2
  import react__default, { MouseEvent } from 'react';
3
- import { l as WalletClientType, d as UserRecoveryMethod, m as PrivyFarcasterSignerInitResponse, n as MfaSubmitArgs, E as EthereumRpcRequestType, o as SolanaRpcRequestType, p as EthereumRpcResponseType, q as SolanaRpcResponseType, r as PrivyClientConfig, s as EIP1193Provider, u as EntropyIdVerifier$1, v as RequestArguments, w as WalletTimeoutError, x as WalletConnector, B as BaseConnectedEthereumWallet, y as ConnectedWalletMetadata, z as ConnectorType, A as WalletListEntry, D as ExternalWalletsConfig, G as BaseConnectedWallet, k as SolanaWalletConnector, U as User, H as ConnectWalletModalOptions, I as LoginModalOptions, g as CreateWalletOptions, W as Wallet, J as SetWalletRecoveryOptions, i as SignMessageModalUIOptions, K as SignTypedDataParams, M as MfaMethod, N as UnsignedTransactionRequest, h as SendTransactionModalUIOptions, Q as FundWalletConfig, T as ConnectedWallet, O as OAuthTokens, V as CrossAppProviderDetails, X as OAuthProviderType, Y as MoonpaySignRequest, Z as MoonpaySignResponse, _ as SmartWalletConfig, a as LoginMethod, $ as SiweWalletMetadata, a0 as TelegramAuthResult, a1 as TelegramWebAppData, a2 as OAuthUserInfo, a3 as OAuthFlowState, a4 as LoginWithCode, a5 as OtpFlowState, a6 as PasskeyFlowState, a7 as SiweFlowState, a8 as UnsignedTransactionRequestWithChainId, a9 as BaseConnectedWalletType, C as ConnectedSolanaWallet, aa as CustomAuthFlowState, ab as TelegramAuthFlowState } from './types-Cq3xKsys.js';
4
- export { au as Apple, aF as AppleOAuthWithMetadata, aN as ContractUIOptions, ax as CrossAppAccount, aI as CrossAppAccountWithMetadata, ar as Discord, aB as DiscordOAuthWithMetadata, aK as Email, am as EmailWithMetadata, aR as Farcaster, aG as FarcasterWithMetadata, as as Github, aC as GithubOAuthWithMetadata, ap as Google, az as GoogleOAuthWithMetadata, ay as LinkedAccountType, b as LinkedAccountWithMetadata, at as LinkedIn, aE as LinkedInOAuthWithMetadata, aT as LoginMethodOrderOption, ad as MessageTypes, af as MoonpayConfig, ag as MoonpayCurrencyCode, aP as MoonpayFundingConfig, ah as MoonpayPaymentMethod, aO as NativeFundingConfig, al as NonEmptyArray, aS as Passkey, aJ as PasskeyWithMetadata, aL as Phone, an as PhoneWithMetadata, aQ as PriceDisplayOptions, P as PrivyErrorCode, ai as Quantity, ae as SmartWallet, f as SolanaCluster, j as SolanaFundingConfig, S as SolanaTransactionReceipt, e as SupportedSolanaTransaction, aw as Telegram, aH as TelegramWithMetadata, av as Tiktok, aD as TiktokOAuthWithMetadata, aj as TransactionLog, ak as TransactionReceipt, aM as TransactionUIOptions, aq as Twitter, aA as TwitterOAuthWithMetadata, ac as TypedMessage, ao as WalletWithMetadata } from './types-Cq3xKsys.js';
3
+ import { l as WalletClientType, d as UserRecoveryMethod, m as PrivyFarcasterSignerInitResponse, n as MfaSubmitArgs, E as EthereumRpcRequestType, o as SolanaRpcRequestType, p as EthereumRpcResponseType, q as SolanaRpcResponseType, r as PrivyClientConfig, s as EIP1193Provider, u as EntropyIdVerifier$1, v as RequestArguments, w as WalletTimeoutError, x as WalletConnector, B as BaseConnectedEthereumWallet, y as ConnectedWalletMetadata, z as ConnectorType, A as WalletListEntry, D as ExternalWalletsConfig, G as BaseConnectedWallet, k as SolanaWalletConnector, U as User, H as ConnectWalletModalOptions, I as LoginModalOptions, g as CreateWalletOptions, W as Wallet, J as SetWalletRecoveryOptions, i as SignMessageModalUIOptions, K as SignTypedDataParams, M as MfaMethod, N as UnsignedTransactionRequest, h as SendTransactionModalUIOptions, Q as FundWalletConfig, T as ConnectedWallet, O as OAuthTokens, V as CrossAppProviderDetails, X as OAuthProviderType, Y as MoonpaySignRequest, Z as MoonpaySignResponse, _ as SmartWalletConfig, a as LoginMethod, $ as SiweWalletMetadata, a0 as TelegramAuthResult, a1 as TelegramWebAppData, a2 as OAuthUserInfo, a3 as OAuthFlowState, a4 as LoginWithCode, a5 as OtpFlowState, a6 as PasskeyFlowState, a7 as SiweFlowState, a8 as UnsignedTransactionRequestWithChainId, a9 as BaseConnectedWalletType, C as ConnectedSolanaWallet, aa as TelegramAuthFlowState } from './types-B92M8x5e.js';
4
+ export { at as Apple, aE as AppleOAuthWithMetadata, aM as ContractUIOptions, aw as CrossAppAccount, aH as CrossAppAccountWithMetadata, aq as Discord, aA as DiscordOAuthWithMetadata, aJ as Email, al as EmailWithMetadata, aQ as Farcaster, aF as FarcasterWithMetadata, ar as Github, aB as GithubOAuthWithMetadata, ao as Google, ay as GoogleOAuthWithMetadata, ax as LinkedAccountType, b as LinkedAccountWithMetadata, as as LinkedIn, aD as LinkedInOAuthWithMetadata, aS as LoginMethodOrderOption, ac as MessageTypes, ae as MoonpayConfig, af as MoonpayCurrencyCode, aO as MoonpayFundingConfig, ag as MoonpayPaymentMethod, aN as NativeFundingConfig, ak as NonEmptyArray, aR as Passkey, aI as PasskeyWithMetadata, aK as Phone, am as PhoneWithMetadata, aP as PriceDisplayOptions, P as PrivyErrorCode, ah as Quantity, ad as SmartWallet, f as SolanaCluster, j as SolanaFundingConfig, S as SolanaTransactionReceipt, e as SupportedSolanaTransaction, av as Telegram, aG as TelegramWithMetadata, au as Tiktok, aC as TiktokOAuthWithMetadata, ai as TransactionLog, aj as TransactionReceipt, aL as TransactionUIOptions, ap as Twitter, az as TwitterOAuthWithMetadata, ab as TypedMessage, an as WalletWithMetadata } from './types-B92M8x5e.js';
5
5
  import * as react_jsx_runtime from 'react/jsx-runtime';
6
6
  import { TurnstileProps } from '@marsidev/react-turnstile';
7
7
  import EventEmitter from 'eventemitter3';
@@ -16,8 +16,8 @@ import * as _simplewebauthn_types from '@simplewebauthn/types';
16
16
  import { PublicKeyCredentialRequestOptionsJSON } from '@simplewebauthn/types';
17
17
  import { Cluster } from '@solana/web3.js';
18
18
  import { FetchOptions } from 'ofetch';
19
- import { P as PrivyEvents } from './useSolanaWallets-BADh6ZyK.js';
20
- export { C as CallbackError, U as UseSolanaWalletsInterface, u as useSolanaWallets } from './useSolanaWallets-BADh6ZyK.js';
19
+ import { P as PrivyEvents } from './useSolanaWallets-BSNPWBSM.js';
20
+ export { C as CallbackError, U as UseSolanaWalletsInterface, u as useSolanaWallets } from './useSolanaWallets-BSNPWBSM.js';
21
21
  import '@solana/wallet-adapter-base';
22
22
  import '@metamask/eth-sig-util';
23
23
 
@@ -3617,6 +3617,24 @@ type UseOAuthTokens = {
3617
3617
  */
3618
3618
  declare function useOAuthTokens(callbacks?: PrivyEvents['oAuthAuthorization']): UseOAuthTokens;
3619
3619
 
3620
+ /**
3621
+ * The state of the JWT auth flow.
3622
+ */
3623
+ type JwtAuthFlowState = {
3624
+ status: 'initial';
3625
+ } | {
3626
+ status: 'loading';
3627
+ } | {
3628
+ status: 'not-enabled';
3629
+ } | {
3630
+ status: 'done';
3631
+ } | {
3632
+ status: 'error';
3633
+ error: Error | null;
3634
+ };
3635
+ /** @deprecated type will be replaced with its equivalent, {@link JwtAuthFlowState} */
3636
+ type CustomAuthFlowState = JwtAuthFlowState;
3637
+
3620
3638
  type UseCustomAuth = {
3621
3639
  /**
3622
3640
  * Object that indicates the status of Privy's custom auth flow.
@@ -3636,9 +3654,124 @@ type UseCustomAuth = {
3636
3654
  * Use this hook to check the Privy auth flow status for whenever third-party/custom auth is enabled.
3637
3655
  *
3638
3656
  * @returns status - auth flow/ JWT exchange status of the Privy user, if custom auth is enabled
3657
+ * @deprecated Use `useSyncJwtBasedAuthState` instead.
3639
3658
  */
3640
3659
  declare const useCustomAuth: (callbacks?: PrivyEvents["customAuth"]) => UseCustomAuth;
3641
3660
 
3661
+ type OnJwtAuthStateChange = () => void;
3662
+ type UnsubscribeFromJwtAuth = () => void;
3663
+ type SubscribeToJwtAuth = (onJwtAuthStateChange: OnJwtAuthStateChange) => UnsubscribeFromJwtAuth;
3664
+ type OnAuthenticatedEvent = {
3665
+ user: User;
3666
+ isNewUser: boolean;
3667
+ };
3668
+ interface UseSyncJwtBasedAuthStateInput {
3669
+ /**
3670
+ * A function that returns a JWT token from the external system.
3671
+ * If the user is not authenticated, this function should return `undefined`.
3672
+ *
3673
+ * This function **should not throw** and doing so will result in the user being
3674
+ * logged out.
3675
+ */
3676
+ getExternalJwt: () => Promise<string | undefined>;
3677
+ /**
3678
+ * This callback is used by Privy for subscribing to changes in the state of
3679
+ * the external authentication system.
3680
+ * It should return a function that can be called to unsubscribe so as to
3681
+ * avoid stale listeners.
3682
+ *
3683
+ * The passed callback should be wrapped in a `useCallback` to avoid
3684
+ * re-subscribing too often.
3685
+ *
3686
+ * Consider using `useSubscribeToJwtAuthWithFlag` if the external system
3687
+ * offers an `isAuthenticated` flag instead of direct listeners.
3688
+ *
3689
+ * @example
3690
+ * subscribe: useCallback((onAuthStateChange) => {
3691
+ * SomeAuthManager.addEventListener('session', onAuthStateChange);
3692
+ * return () => {
3693
+ * SomeAuthManager.removeEventListener('session', onAuthStateChange);
3694
+ * };
3695
+ * }, [])
3696
+ */
3697
+ subscribe: SubscribeToJwtAuth;
3698
+ /**
3699
+ * Whether the external JWT authentication system is enabled.
3700
+ * This can be used to disable the sync process when the external system is
3701
+ * not enabled or otherwise not available.
3702
+ */
3703
+ enabled?: boolean;
3704
+ /**
3705
+ * A callback that is called when the user is authenticated in Privy after
3706
+ * syncing with the external system.
3707
+ */
3708
+ onAuthenticated?: (event: OnAuthenticatedEvent) => void;
3709
+ /**
3710
+ * A callback that is called when the user is unauthenticated in Privy after
3711
+ * syncing with the external system.
3712
+ */
3713
+ onUnauthenticated?: () => void;
3714
+ /**
3715
+ * A callback that is called when an error occurs during the sync process.
3716
+ */
3717
+ onError?: (error: Error) => void;
3718
+ }
3719
+ interface UseSyncJwtBasedAuthStateInterface {
3720
+ /**
3721
+ * The current state of the JWT authentication flow.
3722
+ */
3723
+ state: JwtAuthFlowState;
3724
+ }
3725
+ /**
3726
+ * Hook to sync the state of a JWT-based external authentication system with Privy.
3727
+ *
3728
+ * When "JWT-based authentication" is enabled, this hook will be used to sync the state of the
3729
+ * external system back to Privy.
3730
+ *
3731
+ * Make sure to call this hook in a component that is mounted throughout the lifetime of the application,
3732
+ * whether the user is authenticated or not.
3733
+ *
3734
+ * @returns An object containing the current state of the JWT authentication flow.
3735
+ */
3736
+ declare function useSyncJwtBasedAuthState({ subscribe, getExternalJwt, enabled, onAuthenticated, onUnauthenticated, onError, }: UseSyncJwtBasedAuthStateInput): UseSyncJwtBasedAuthStateInterface;
3737
+
3738
+ interface UseSubscribeToJwtAuthWithFlagInput extends Omit<UseSyncJwtBasedAuthStateInput, 'subscribe'> {
3739
+ /**
3740
+ * A flag indicating whether the user is authenticated in the external
3741
+ * JWT-based authentication system.
3742
+ *
3743
+ * Changes to this value in any direction will trigger a re-synchronization of
3744
+ * the Privy JWT authentication state.
3745
+ */
3746
+ isAuthenticated?: boolean;
3747
+ /**
3748
+ * A flag indicating whether the external JWT-based authentication system is
3749
+ * loading or otherwise refreshing its state.
3750
+ *
3751
+ * Changes to this value in any direction will trigger a re-synchronization of
3752
+ * the Privy JWT authentication state.
3753
+ */
3754
+ isLoading?: boolean;
3755
+ }
3756
+ /**
3757
+ * This is a utility hook for subscribing to an external JWT-based
3758
+ * authentication system that offers a "flag" or hook based API, with values like `isAuthenticated`,
3759
+ * instead of direct listeners on auth state changes
3760
+ *
3761
+ * @returns An object containing the current state of the JWT authentication flow.
3762
+ *
3763
+ * @see {@link useSyncJwtBasedAuthState} for more information on syncing JWT authentication state.
3764
+ *
3765
+ * @example
3766
+ * const {isAuthenticated, getAccessToken} = useSomeAuthSystem();
3767
+ *
3768
+ * const {subscribe} = useSubscribeToJwtAuthWithFlag({
3769
+ * isAuthenticated,
3770
+ * getExternalJwt: getAccessToken,
3771
+ * });
3772
+ */
3773
+ declare function useSubscribeToJwtAuthWithFlag({ isAuthenticated, isLoading, ...useSyncJwtBasedAuthStateInput }: UseSubscribeToJwtAuthWithFlagInput): UseSyncJwtBasedAuthStateInterface;
3774
+
3642
3775
  /**
3643
3776
  * Use this hook to write to Farcaster.
3644
3777
  *
@@ -3756,4 +3889,4 @@ declare const LoginModal: ({ open }: {
3756
3889
  open: boolean;
3757
3890
  }) => react_jsx_runtime.JSX.Element;
3758
3891
 
3759
- export { BaseConnectedWalletType, Captcha, ConnectWalletModalOptions, ConnectedSolanaWallet, ConnectedWallet, ConnectorManager, CustomAuthFlowState, EIP1193Provider, EthereumWalletConnector, FundWalletConfig, LoginModal, LoginModalOptions, LoginWithCode, MfaMethod, OAuthFlowState, OAuthProviderType, OAuthTokens, OtpFlowState, PasskeyFlowState, PrivyClient, PrivyClientConfig, PrivyEvents, type PrivyInterface, PrivyProvider, type PrivyProviderProps, type SendCodeToEmail, type SendCodeToSms, SendTransactionModalUIOptions, SignMessageModalUIOptions, SignTypedDataParams, SiweFlowState, TelegramAuthFlowState, UnsignedTransactionRequest, type UseConnectCoinbaseSmartWalletInterface, type UseCustomAuth, type UseDelegatedActionsInterface, type UseFundWalletInterface, type UseImportWalletInterface, type UseLinkWithPasskey, type UseLoginWithEmail, type UseLoginWithPasskey, type UseLoginWithSms, type UseLoginWithTelegram, type UseOAuthTokens, type UseRecoverEmbeddedWalletInterface, type UseSignupWithPasskey, type UseWalletsInterface, User, VERSION, Wallet, WalletConnector, WalletListEntry, errorIndicatesMaxMfaRetries, errorIndicatesMfaTimeout, errorIndicatesMfaVerificationFailed, getCustomerAccessToken as getAccessToken, getEmbeddedConnectedWallet, useActiveWallet, useConnectCoinbaseSmartWallet, useConnectOrCreateWallet, useConnectWallet, useCreateWallet, useCrossAppAccounts, useCustomAuth, useDelegatedActions, useFarcasterSigner, useFundWallet, useGuestAccounts, useHeadlessDelegatedActions, useIdentityToken, useImportWallet, useLinkAccount, useLinkWithPasskey, useLinkWithSiwe, useLogin, useLoginWithEmail, useLoginWithFarcasterV2, useLoginWithOAuth, useLoginWithPasskey, useLoginWithSms, useLoginWithTelegram, useLogout, useMfa, useMfaEnrollment, useModalStatus, useOAuthTokens, usePrivy, useRecoverEmbeddedWallet, useRegisterMfaListener, useSendTransaction, useSetWalletPassword, useSetWalletRecovery, useSignAuthorization, useSignMessage, useSignTransaction, useSignTypedData, useSignupWithPasskey, useToken, useUpdateAccount, useUser, useWallets };
3892
+ export { BaseConnectedWalletType, Captcha, ConnectWalletModalOptions, ConnectedSolanaWallet, ConnectedWallet, ConnectorManager, type CustomAuthFlowState, EIP1193Provider, EthereumWalletConnector, FundWalletConfig, type JwtAuthFlowState, LoginModal, LoginModalOptions, LoginWithCode, MfaMethod, OAuthFlowState, OAuthProviderType, OAuthTokens, OtpFlowState, PasskeyFlowState, PrivyClient, PrivyClientConfig, PrivyEvents, type PrivyInterface, PrivyProvider, type PrivyProviderProps, type SendCodeToEmail, type SendCodeToSms, SendTransactionModalUIOptions, SignMessageModalUIOptions, SignTypedDataParams, SiweFlowState, TelegramAuthFlowState, UnsignedTransactionRequest, type UseConnectCoinbaseSmartWalletInterface, type UseCustomAuth, type UseDelegatedActionsInterface, type UseFundWalletInterface, type UseImportWalletInterface, type UseLinkWithPasskey, type UseLoginWithEmail, type UseLoginWithPasskey, type UseLoginWithSms, type UseLoginWithTelegram, type UseOAuthTokens, type UseRecoverEmbeddedWalletInterface, type UseSignupWithPasskey, type UseSubscribeToJwtAuthWithFlagInput, type UseSyncJwtBasedAuthStateInput, type UseSyncJwtBasedAuthStateInterface, type UseWalletsInterface, User, VERSION, Wallet, WalletConnector, WalletListEntry, errorIndicatesMaxMfaRetries, errorIndicatesMfaTimeout, errorIndicatesMfaVerificationFailed, getCustomerAccessToken as getAccessToken, getEmbeddedConnectedWallet, useActiveWallet, useConnectCoinbaseSmartWallet, useConnectOrCreateWallet, useConnectWallet, useCreateWallet, useCrossAppAccounts, useCustomAuth, useDelegatedActions, useFarcasterSigner, useFundWallet, useGuestAccounts, useHeadlessDelegatedActions, useIdentityToken, useImportWallet, useLinkAccount, useLinkWithPasskey, useLinkWithSiwe, useLogin, useLoginWithEmail, useLoginWithFarcasterV2, useLoginWithOAuth, useLoginWithPasskey, useLoginWithSms, useLoginWithTelegram, useLogout, useMfa, useMfaEnrollment, useModalStatus, useOAuthTokens, usePrivy, useRecoverEmbeddedWallet, useRegisterMfaListener, useSendTransaction, useSetWalletPassword, useSetWalletRecovery, useSignAuthorization, useSignMessage, useSignTransaction, useSignTypedData, useSignupWithPasskey, useSubscribeToJwtAuthWithFlag, useSyncJwtBasedAuthState, useToken, useUpdateAccount, useUser, useWallets };
@@ -1,7 +1,7 @@
1
1
  import * as react from 'react';
2
2
  import react__default, { MouseEvent } from 'react';
3
- import { l as WalletClientType, d as UserRecoveryMethod, m as PrivyFarcasterSignerInitResponse, n as MfaSubmitArgs, E as EthereumRpcRequestType, o as SolanaRpcRequestType, p as EthereumRpcResponseType, q as SolanaRpcResponseType, r as PrivyClientConfig, s as EIP1193Provider, u as EntropyIdVerifier$1, v as RequestArguments, w as WalletTimeoutError, x as WalletConnector, B as BaseConnectedEthereumWallet, y as ConnectedWalletMetadata, z as ConnectorType, A as WalletListEntry, D as ExternalWalletsConfig, G as BaseConnectedWallet, k as SolanaWalletConnector, U as User, H as ConnectWalletModalOptions, I as LoginModalOptions, g as CreateWalletOptions, W as Wallet, J as SetWalletRecoveryOptions, i as SignMessageModalUIOptions, K as SignTypedDataParams, M as MfaMethod, N as UnsignedTransactionRequest, h as SendTransactionModalUIOptions, Q as FundWalletConfig, T as ConnectedWallet, O as OAuthTokens, V as CrossAppProviderDetails, X as OAuthProviderType, Y as MoonpaySignRequest, Z as MoonpaySignResponse, _ as SmartWalletConfig, a as LoginMethod, $ as SiweWalletMetadata, a0 as TelegramAuthResult, a1 as TelegramWebAppData, a2 as OAuthUserInfo, a3 as OAuthFlowState, a4 as LoginWithCode, a5 as OtpFlowState, a6 as PasskeyFlowState, a7 as SiweFlowState, a8 as UnsignedTransactionRequestWithChainId, a9 as BaseConnectedWalletType, C as ConnectedSolanaWallet, aa as CustomAuthFlowState, ab as TelegramAuthFlowState } from './types-Cq3xKsys.js';
4
- export { au as Apple, aF as AppleOAuthWithMetadata, aN as ContractUIOptions, ax as CrossAppAccount, aI as CrossAppAccountWithMetadata, ar as Discord, aB as DiscordOAuthWithMetadata, aK as Email, am as EmailWithMetadata, aR as Farcaster, aG as FarcasterWithMetadata, as as Github, aC as GithubOAuthWithMetadata, ap as Google, az as GoogleOAuthWithMetadata, ay as LinkedAccountType, b as LinkedAccountWithMetadata, at as LinkedIn, aE as LinkedInOAuthWithMetadata, aT as LoginMethodOrderOption, ad as MessageTypes, af as MoonpayConfig, ag as MoonpayCurrencyCode, aP as MoonpayFundingConfig, ah as MoonpayPaymentMethod, aO as NativeFundingConfig, al as NonEmptyArray, aS as Passkey, aJ as PasskeyWithMetadata, aL as Phone, an as PhoneWithMetadata, aQ as PriceDisplayOptions, P as PrivyErrorCode, ai as Quantity, ae as SmartWallet, f as SolanaCluster, j as SolanaFundingConfig, S as SolanaTransactionReceipt, e as SupportedSolanaTransaction, aw as Telegram, aH as TelegramWithMetadata, av as Tiktok, aD as TiktokOAuthWithMetadata, aj as TransactionLog, ak as TransactionReceipt, aM as TransactionUIOptions, aq as Twitter, aA as TwitterOAuthWithMetadata, ac as TypedMessage, ao as WalletWithMetadata } from './types-Cq3xKsys.js';
3
+ import { l as WalletClientType, d as UserRecoveryMethod, m as PrivyFarcasterSignerInitResponse, n as MfaSubmitArgs, E as EthereumRpcRequestType, o as SolanaRpcRequestType, p as EthereumRpcResponseType, q as SolanaRpcResponseType, r as PrivyClientConfig, s as EIP1193Provider, u as EntropyIdVerifier$1, v as RequestArguments, w as WalletTimeoutError, x as WalletConnector, B as BaseConnectedEthereumWallet, y as ConnectedWalletMetadata, z as ConnectorType, A as WalletListEntry, D as ExternalWalletsConfig, G as BaseConnectedWallet, k as SolanaWalletConnector, U as User, H as ConnectWalletModalOptions, I as LoginModalOptions, g as CreateWalletOptions, W as Wallet, J as SetWalletRecoveryOptions, i as SignMessageModalUIOptions, K as SignTypedDataParams, M as MfaMethod, N as UnsignedTransactionRequest, h as SendTransactionModalUIOptions, Q as FundWalletConfig, T as ConnectedWallet, O as OAuthTokens, V as CrossAppProviderDetails, X as OAuthProviderType, Y as MoonpaySignRequest, Z as MoonpaySignResponse, _ as SmartWalletConfig, a as LoginMethod, $ as SiweWalletMetadata, a0 as TelegramAuthResult, a1 as TelegramWebAppData, a2 as OAuthUserInfo, a3 as OAuthFlowState, a4 as LoginWithCode, a5 as OtpFlowState, a6 as PasskeyFlowState, a7 as SiweFlowState, a8 as UnsignedTransactionRequestWithChainId, a9 as BaseConnectedWalletType, C as ConnectedSolanaWallet, aa as TelegramAuthFlowState } from './types-B92M8x5e.js';
4
+ export { at as Apple, aE as AppleOAuthWithMetadata, aM as ContractUIOptions, aw as CrossAppAccount, aH as CrossAppAccountWithMetadata, aq as Discord, aA as DiscordOAuthWithMetadata, aJ as Email, al as EmailWithMetadata, aQ as Farcaster, aF as FarcasterWithMetadata, ar as Github, aB as GithubOAuthWithMetadata, ao as Google, ay as GoogleOAuthWithMetadata, ax as LinkedAccountType, b as LinkedAccountWithMetadata, as as LinkedIn, aD as LinkedInOAuthWithMetadata, aS as LoginMethodOrderOption, ac as MessageTypes, ae as MoonpayConfig, af as MoonpayCurrencyCode, aO as MoonpayFundingConfig, ag as MoonpayPaymentMethod, aN as NativeFundingConfig, ak as NonEmptyArray, aR as Passkey, aI as PasskeyWithMetadata, aK as Phone, am as PhoneWithMetadata, aP as PriceDisplayOptions, P as PrivyErrorCode, ah as Quantity, ad as SmartWallet, f as SolanaCluster, j as SolanaFundingConfig, S as SolanaTransactionReceipt, e as SupportedSolanaTransaction, av as Telegram, aG as TelegramWithMetadata, au as Tiktok, aC as TiktokOAuthWithMetadata, ai as TransactionLog, aj as TransactionReceipt, aL as TransactionUIOptions, ap as Twitter, az as TwitterOAuthWithMetadata, ab as TypedMessage, an as WalletWithMetadata } from './types-B92M8x5e.js';
5
5
  import * as react_jsx_runtime from 'react/jsx-runtime';
6
6
  import { TurnstileProps } from '@marsidev/react-turnstile';
7
7
  import EventEmitter from 'eventemitter3';
@@ -16,8 +16,8 @@ import * as _simplewebauthn_types from '@simplewebauthn/types';
16
16
  import { PublicKeyCredentialRequestOptionsJSON } from '@simplewebauthn/types';
17
17
  import { Cluster } from '@solana/web3.js';
18
18
  import { FetchOptions } from 'ofetch';
19
- import { P as PrivyEvents } from './useSolanaWallets-BADh6ZyK.js';
20
- export { C as CallbackError, U as UseSolanaWalletsInterface, u as useSolanaWallets } from './useSolanaWallets-BADh6ZyK.js';
19
+ import { P as PrivyEvents } from './useSolanaWallets-BSNPWBSM.js';
20
+ export { C as CallbackError, U as UseSolanaWalletsInterface, u as useSolanaWallets } from './useSolanaWallets-BSNPWBSM.js';
21
21
  import '@solana/wallet-adapter-base';
22
22
  import '@metamask/eth-sig-util';
23
23
 
@@ -3617,6 +3617,24 @@ type UseOAuthTokens = {
3617
3617
  */
3618
3618
  declare function useOAuthTokens(callbacks?: PrivyEvents['oAuthAuthorization']): UseOAuthTokens;
3619
3619
 
3620
+ /**
3621
+ * The state of the JWT auth flow.
3622
+ */
3623
+ type JwtAuthFlowState = {
3624
+ status: 'initial';
3625
+ } | {
3626
+ status: 'loading';
3627
+ } | {
3628
+ status: 'not-enabled';
3629
+ } | {
3630
+ status: 'done';
3631
+ } | {
3632
+ status: 'error';
3633
+ error: Error | null;
3634
+ };
3635
+ /** @deprecated type will be replaced with its equivalent, {@link JwtAuthFlowState} */
3636
+ type CustomAuthFlowState = JwtAuthFlowState;
3637
+
3620
3638
  type UseCustomAuth = {
3621
3639
  /**
3622
3640
  * Object that indicates the status of Privy's custom auth flow.
@@ -3636,9 +3654,124 @@ type UseCustomAuth = {
3636
3654
  * Use this hook to check the Privy auth flow status for whenever third-party/custom auth is enabled.
3637
3655
  *
3638
3656
  * @returns status - auth flow/ JWT exchange status of the Privy user, if custom auth is enabled
3657
+ * @deprecated Use `useSyncJwtBasedAuthState` instead.
3639
3658
  */
3640
3659
  declare const useCustomAuth: (callbacks?: PrivyEvents["customAuth"]) => UseCustomAuth;
3641
3660
 
3661
+ type OnJwtAuthStateChange = () => void;
3662
+ type UnsubscribeFromJwtAuth = () => void;
3663
+ type SubscribeToJwtAuth = (onJwtAuthStateChange: OnJwtAuthStateChange) => UnsubscribeFromJwtAuth;
3664
+ type OnAuthenticatedEvent = {
3665
+ user: User;
3666
+ isNewUser: boolean;
3667
+ };
3668
+ interface UseSyncJwtBasedAuthStateInput {
3669
+ /**
3670
+ * A function that returns a JWT token from the external system.
3671
+ * If the user is not authenticated, this function should return `undefined`.
3672
+ *
3673
+ * This function **should not throw** and doing so will result in the user being
3674
+ * logged out.
3675
+ */
3676
+ getExternalJwt: () => Promise<string | undefined>;
3677
+ /**
3678
+ * This callback is used by Privy for subscribing to changes in the state of
3679
+ * the external authentication system.
3680
+ * It should return a function that can be called to unsubscribe so as to
3681
+ * avoid stale listeners.
3682
+ *
3683
+ * The passed callback should be wrapped in a `useCallback` to avoid
3684
+ * re-subscribing too often.
3685
+ *
3686
+ * Consider using `useSubscribeToJwtAuthWithFlag` if the external system
3687
+ * offers an `isAuthenticated` flag instead of direct listeners.
3688
+ *
3689
+ * @example
3690
+ * subscribe: useCallback((onAuthStateChange) => {
3691
+ * SomeAuthManager.addEventListener('session', onAuthStateChange);
3692
+ * return () => {
3693
+ * SomeAuthManager.removeEventListener('session', onAuthStateChange);
3694
+ * };
3695
+ * }, [])
3696
+ */
3697
+ subscribe: SubscribeToJwtAuth;
3698
+ /**
3699
+ * Whether the external JWT authentication system is enabled.
3700
+ * This can be used to disable the sync process when the external system is
3701
+ * not enabled or otherwise not available.
3702
+ */
3703
+ enabled?: boolean;
3704
+ /**
3705
+ * A callback that is called when the user is authenticated in Privy after
3706
+ * syncing with the external system.
3707
+ */
3708
+ onAuthenticated?: (event: OnAuthenticatedEvent) => void;
3709
+ /**
3710
+ * A callback that is called when the user is unauthenticated in Privy after
3711
+ * syncing with the external system.
3712
+ */
3713
+ onUnauthenticated?: () => void;
3714
+ /**
3715
+ * A callback that is called when an error occurs during the sync process.
3716
+ */
3717
+ onError?: (error: Error) => void;
3718
+ }
3719
+ interface UseSyncJwtBasedAuthStateInterface {
3720
+ /**
3721
+ * The current state of the JWT authentication flow.
3722
+ */
3723
+ state: JwtAuthFlowState;
3724
+ }
3725
+ /**
3726
+ * Hook to sync the state of a JWT-based external authentication system with Privy.
3727
+ *
3728
+ * When "JWT-based authentication" is enabled, this hook will be used to sync the state of the
3729
+ * external system back to Privy.
3730
+ *
3731
+ * Make sure to call this hook in a component that is mounted throughout the lifetime of the application,
3732
+ * whether the user is authenticated or not.
3733
+ *
3734
+ * @returns An object containing the current state of the JWT authentication flow.
3735
+ */
3736
+ declare function useSyncJwtBasedAuthState({ subscribe, getExternalJwt, enabled, onAuthenticated, onUnauthenticated, onError, }: UseSyncJwtBasedAuthStateInput): UseSyncJwtBasedAuthStateInterface;
3737
+
3738
+ interface UseSubscribeToJwtAuthWithFlagInput extends Omit<UseSyncJwtBasedAuthStateInput, 'subscribe'> {
3739
+ /**
3740
+ * A flag indicating whether the user is authenticated in the external
3741
+ * JWT-based authentication system.
3742
+ *
3743
+ * Changes to this value in any direction will trigger a re-synchronization of
3744
+ * the Privy JWT authentication state.
3745
+ */
3746
+ isAuthenticated?: boolean;
3747
+ /**
3748
+ * A flag indicating whether the external JWT-based authentication system is
3749
+ * loading or otherwise refreshing its state.
3750
+ *
3751
+ * Changes to this value in any direction will trigger a re-synchronization of
3752
+ * the Privy JWT authentication state.
3753
+ */
3754
+ isLoading?: boolean;
3755
+ }
3756
+ /**
3757
+ * This is a utility hook for subscribing to an external JWT-based
3758
+ * authentication system that offers a "flag" or hook based API, with values like `isAuthenticated`,
3759
+ * instead of direct listeners on auth state changes
3760
+ *
3761
+ * @returns An object containing the current state of the JWT authentication flow.
3762
+ *
3763
+ * @see {@link useSyncJwtBasedAuthState} for more information on syncing JWT authentication state.
3764
+ *
3765
+ * @example
3766
+ * const {isAuthenticated, getAccessToken} = useSomeAuthSystem();
3767
+ *
3768
+ * const {subscribe} = useSubscribeToJwtAuthWithFlag({
3769
+ * isAuthenticated,
3770
+ * getExternalJwt: getAccessToken,
3771
+ * });
3772
+ */
3773
+ declare function useSubscribeToJwtAuthWithFlag({ isAuthenticated, isLoading, ...useSyncJwtBasedAuthStateInput }: UseSubscribeToJwtAuthWithFlagInput): UseSyncJwtBasedAuthStateInterface;
3774
+
3642
3775
  /**
3643
3776
  * Use this hook to write to Farcaster.
3644
3777
  *
@@ -3756,4 +3889,4 @@ declare const LoginModal: ({ open }: {
3756
3889
  open: boolean;
3757
3890
  }) => react_jsx_runtime.JSX.Element;
3758
3891
 
3759
- export { BaseConnectedWalletType, Captcha, ConnectWalletModalOptions, ConnectedSolanaWallet, ConnectedWallet, ConnectorManager, CustomAuthFlowState, EIP1193Provider, EthereumWalletConnector, FundWalletConfig, LoginModal, LoginModalOptions, LoginWithCode, MfaMethod, OAuthFlowState, OAuthProviderType, OAuthTokens, OtpFlowState, PasskeyFlowState, PrivyClient, PrivyClientConfig, PrivyEvents, type PrivyInterface, PrivyProvider, type PrivyProviderProps, type SendCodeToEmail, type SendCodeToSms, SendTransactionModalUIOptions, SignMessageModalUIOptions, SignTypedDataParams, SiweFlowState, TelegramAuthFlowState, UnsignedTransactionRequest, type UseConnectCoinbaseSmartWalletInterface, type UseCustomAuth, type UseDelegatedActionsInterface, type UseFundWalletInterface, type UseImportWalletInterface, type UseLinkWithPasskey, type UseLoginWithEmail, type UseLoginWithPasskey, type UseLoginWithSms, type UseLoginWithTelegram, type UseOAuthTokens, type UseRecoverEmbeddedWalletInterface, type UseSignupWithPasskey, type UseWalletsInterface, User, VERSION, Wallet, WalletConnector, WalletListEntry, errorIndicatesMaxMfaRetries, errorIndicatesMfaTimeout, errorIndicatesMfaVerificationFailed, getCustomerAccessToken as getAccessToken, getEmbeddedConnectedWallet, useActiveWallet, useConnectCoinbaseSmartWallet, useConnectOrCreateWallet, useConnectWallet, useCreateWallet, useCrossAppAccounts, useCustomAuth, useDelegatedActions, useFarcasterSigner, useFundWallet, useGuestAccounts, useHeadlessDelegatedActions, useIdentityToken, useImportWallet, useLinkAccount, useLinkWithPasskey, useLinkWithSiwe, useLogin, useLoginWithEmail, useLoginWithFarcasterV2, useLoginWithOAuth, useLoginWithPasskey, useLoginWithSms, useLoginWithTelegram, useLogout, useMfa, useMfaEnrollment, useModalStatus, useOAuthTokens, usePrivy, useRecoverEmbeddedWallet, useRegisterMfaListener, useSendTransaction, useSetWalletPassword, useSetWalletRecovery, useSignAuthorization, useSignMessage, useSignTransaction, useSignTypedData, useSignupWithPasskey, useToken, useUpdateAccount, useUser, useWallets };
3892
+ export { BaseConnectedWalletType, Captcha, ConnectWalletModalOptions, ConnectedSolanaWallet, ConnectedWallet, ConnectorManager, type CustomAuthFlowState, EIP1193Provider, EthereumWalletConnector, FundWalletConfig, type JwtAuthFlowState, LoginModal, LoginModalOptions, LoginWithCode, MfaMethod, OAuthFlowState, OAuthProviderType, OAuthTokens, OtpFlowState, PasskeyFlowState, PrivyClient, PrivyClientConfig, PrivyEvents, type PrivyInterface, PrivyProvider, type PrivyProviderProps, type SendCodeToEmail, type SendCodeToSms, SendTransactionModalUIOptions, SignMessageModalUIOptions, SignTypedDataParams, SiweFlowState, TelegramAuthFlowState, UnsignedTransactionRequest, type UseConnectCoinbaseSmartWalletInterface, type UseCustomAuth, type UseDelegatedActionsInterface, type UseFundWalletInterface, type UseImportWalletInterface, type UseLinkWithPasskey, type UseLoginWithEmail, type UseLoginWithPasskey, type UseLoginWithSms, type UseLoginWithTelegram, type UseOAuthTokens, type UseRecoverEmbeddedWalletInterface, type UseSignupWithPasskey, type UseSubscribeToJwtAuthWithFlagInput, type UseSyncJwtBasedAuthStateInput, type UseSyncJwtBasedAuthStateInterface, type UseWalletsInterface, User, VERSION, Wallet, WalletConnector, WalletListEntry, errorIndicatesMaxMfaRetries, errorIndicatesMfaTimeout, errorIndicatesMfaVerificationFailed, getCustomerAccessToken as getAccessToken, getEmbeddedConnectedWallet, useActiveWallet, useConnectCoinbaseSmartWallet, useConnectOrCreateWallet, useConnectWallet, useCreateWallet, useCrossAppAccounts, useCustomAuth, useDelegatedActions, useFarcasterSigner, useFundWallet, useGuestAccounts, useHeadlessDelegatedActions, useIdentityToken, useImportWallet, useLinkAccount, useLinkWithPasskey, useLinkWithSiwe, useLogin, useLoginWithEmail, useLoginWithFarcasterV2, useLoginWithOAuth, useLoginWithPasskey, useLoginWithSms, useLoginWithTelegram, useLogout, useMfa, useMfaEnrollment, useModalStatus, useOAuthTokens, usePrivy, useRecoverEmbeddedWallet, useRegisterMfaListener, useSendTransaction, useSetWalletPassword, useSetWalletRecovery, useSignAuthorization, useSignMessage, useSignTransaction, useSignTypedData, useSignupWithPasskey, useSubscribeToJwtAuthWithFlag, useSyncJwtBasedAuthState, useToken, useUpdateAccount, useUser, useWallets };
@@ -7,7 +7,7 @@ import { SmartAccount, SendUserOperationParameters } from 'viem/account-abstract
7
7
  import * as viem from 'viem';
8
8
  import { SendTransactionParameters, Chain, Hash, SignableMessage, Hex, TypedData, SignTypedDataParameters, EIP1193Provider, PublicClient, Client } from 'viem';
9
9
  import { SmartWalletType } from '@privy-io/js-sdk-core';
10
- import { h as SendTransactionModalUIOptions, i as SignMessageModalUIOptions } from './types-Cq3xKsys.js';
10
+ import { h as SendTransactionModalUIOptions, i as SignMessageModalUIOptions } from './types-B92M8x5e.js';
11
11
  import '@solana/wallet-adapter-base';
12
12
  import '@privy-io/public-api';
13
13
  import '@metamask/eth-sig-util';
@@ -7,7 +7,7 @@ import { SmartAccount, SendUserOperationParameters } from 'viem/account-abstract
7
7
  import * as viem from 'viem';
8
8
  import { SendTransactionParameters, Chain, Hash, SignableMessage, Hex, TypedData, SignTypedDataParameters, EIP1193Provider, PublicClient, Client } from 'viem';
9
9
  import { SmartWalletType } from '@privy-io/js-sdk-core';
10
- import { h as SendTransactionModalUIOptions, i as SignMessageModalUIOptions } from './types-Cq3xKsys.js';
10
+ import { h as SendTransactionModalUIOptions, i as SignMessageModalUIOptions } from './types-B92M8x5e.js';
11
11
  import '@solana/wallet-adapter-base';
12
12
  import '@privy-io/public-api';
13
13
  import '@metamask/eth-sig-util';
@@ -1,7 +1,7 @@
1
- import { W as Wallet, j as SolanaFundingConfig, e as SupportedSolanaTransaction, h as SendTransactionModalUIOptions, S as SolanaTransactionReceipt, i as SignMessageModalUIOptions } from './types-Cq3xKsys.js';
2
- export { C as ConnectedSolanaWallet, k as SolanaAdapterConnector, t as toSolanaWalletConnectors } from './types-Cq3xKsys.js';
3
- import { P as PrivyEvents } from './useSolanaWallets-BADh6ZyK.js';
4
- export { U as UseSolanaWalletsInterface, u as useSolanaWallets } from './useSolanaWallets-BADh6ZyK.js';
1
+ import { W as Wallet, j as SolanaFundingConfig, e as SupportedSolanaTransaction, h as SendTransactionModalUIOptions, S as SolanaTransactionReceipt, i as SignMessageModalUIOptions } from './types-B92M8x5e.js';
2
+ export { C as ConnectedSolanaWallet, k as SolanaAdapterConnector, t as toSolanaWalletConnectors } from './types-B92M8x5e.js';
3
+ import { P as PrivyEvents } from './useSolanaWallets-BSNPWBSM.js';
4
+ export { U as UseSolanaWalletsInterface, u as useSolanaWallets } from './useSolanaWallets-BSNPWBSM.js';
5
5
  import { SendTransactionOptions } from '@solana/wallet-adapter-base';
6
6
  import { Connection } from '@solana/web3.js';
7
7
  import 'react';
@@ -1,7 +1,7 @@
1
- import { W as Wallet, j as SolanaFundingConfig, e as SupportedSolanaTransaction, h as SendTransactionModalUIOptions, S as SolanaTransactionReceipt, i as SignMessageModalUIOptions } from './types-Cq3xKsys.js';
2
- export { C as ConnectedSolanaWallet, k as SolanaAdapterConnector, t as toSolanaWalletConnectors } from './types-Cq3xKsys.js';
3
- import { P as PrivyEvents } from './useSolanaWallets-BADh6ZyK.js';
4
- export { U as UseSolanaWalletsInterface, u as useSolanaWallets } from './useSolanaWallets-BADh6ZyK.js';
1
+ import { W as Wallet, j as SolanaFundingConfig, e as SupportedSolanaTransaction, h as SendTransactionModalUIOptions, S as SolanaTransactionReceipt, i as SignMessageModalUIOptions } from './types-B92M8x5e.js';
2
+ export { C as ConnectedSolanaWallet, k as SolanaAdapterConnector, t as toSolanaWalletConnectors } from './types-B92M8x5e.js';
3
+ import { P as PrivyEvents } from './useSolanaWallets-BSNPWBSM.js';
4
+ export { U as UseSolanaWalletsInterface, u as useSolanaWallets } from './useSolanaWallets-BSNPWBSM.js';
5
5
  import { SendTransactionOptions } from '@solana/wallet-adapter-base';
6
6
  import { Connection } from '@solana/web3.js';
7
7
  import 'react';
@@ -1195,6 +1195,7 @@ interface PrivyClientConfig {
1195
1195
  };
1196
1196
  /**
1197
1197
  * This property is only required for apps that use a third-party authentication provider.
1198
+ * @deprecated Use the `useSyncJwtBasedAuthState` hook instead.
1198
1199
  */
1199
1200
  customAuth?: {
1200
1201
  /**
@@ -1203,12 +1204,15 @@ interface PrivyClientConfig {
1203
1204
  * Defaults to true.
1204
1205
  *
1205
1206
  * @default true
1207
+ * @deprecated Use the `useSyncJwtBasedAuthState` hook instead.
1206
1208
  */
1207
1209
  enabled?: boolean;
1208
1210
  /**
1209
1211
  * A callback that returns the user's custom auth provider's access token as a string.
1210
1212
  * Can be left blank if using cookies to store and send access tokens
1211
1213
  *
1214
+ * @deprecated Use the `useSyncJwtBasedAuthState` hook instead.
1215
+ *
1212
1216
  * @example
1213
1217
  * const {getAccessTokenSilently} = useAuth();
1214
1218
  *
@@ -1225,6 +1229,8 @@ interface PrivyClientConfig {
1225
1229
  /**
1226
1230
  * Custom auth providers loading state
1227
1231
  *
1232
+ * @deprecated Use the `useSyncJwtBasedAuthState` hook instead.
1233
+ *
1228
1234
  * @example
1229
1235
  * const {isLoading} = useAuth();
1230
1236
  *
@@ -1823,18 +1829,6 @@ type CrossAppProviderDetails = {
1823
1829
  name: string;
1824
1830
  icon_url: string | null;
1825
1831
  };
1826
- type CustomAuthFlowState = {
1827
- status: 'initial';
1828
- } | {
1829
- status: 'loading';
1830
- } | {
1831
- status: 'not-enabled';
1832
- } | {
1833
- status: 'done';
1834
- } | {
1835
- status: 'error';
1836
- error: Error | null;
1837
- };
1838
1832
  type LoginToFrame = {
1839
1833
  /**
1840
1834
  * The message the Farcaster wallet signed
@@ -1972,4 +1966,4 @@ type EthereumRpcResponseType = eth_signTransactionResponse | eth_populateTransac
1972
1966
  type SolanaRpcRequestType = solana_signMessage;
1973
1967
  type SolanaRpcResponseType = solana_signMessageResponse;
1974
1968
 
1975
- export { type SiweWalletMetadata as $, type WalletListEntry as A, type BaseConnectedEthereumWallet as B, type ConnectedSolanaWallet as C, type ExternalWalletsConfig as D, type EthereumRpcRequestType as E, type FundingMethod as F, type BaseConnectedWallet as G, type ConnectWalletModalOptions as H, type LoginModalOptions as I, type SetWalletRecoveryOptions as J, type SignTypedDataParams as K, type LoginToFrame as L, type MfaMethod as M, type UnsignedTransactionRequest as N, type OAuthTokens as O, PrivyErrorCode as P, type FundWalletConfig as Q, type RuntimeLoginOverridableOptions as R, type SolanaTransactionReceipt as S, type ConnectedWallet as T, type User as U, type CrossAppProviderDetails as V, type Wallet as W, type OAuthProviderType as X, type MoonpaySignRequest as Y, type MoonpaySignResponse as Z, type SmartWalletConfig as _, type LoginMethod as a, type TelegramAuthResult as a0, type TelegramWebAppData as a1, type OAuthUserInfo as a2, type OAuthFlowState as a3, type LoginWithCode as a4, type OtpFlowState as a5, type PasskeyFlowState as a6, type SiweFlowState as a7, type UnsignedTransactionRequestWithChainId as a8, type BaseConnectedWalletType as a9, type TwitterOAuthWithMetadata as aA, type DiscordOAuthWithMetadata as aB, type GithubOAuthWithMetadata as aC, type TiktokOAuthWithMetadata as aD, type LinkedInOAuthWithMetadata as aE, type AppleOAuthWithMetadata as aF, type FarcasterWithMetadata as aG, type TelegramWithMetadata as aH, type CrossAppAccountWithMetadata as aI, type PasskeyWithMetadata as aJ, type Email as aK, type Phone as aL, type TransactionUIOptions as aM, type ContractUIOptions as aN, type NativeFundingConfig as aO, type MoonpayFundingConfig as aP, type PriceDisplayOptions as aQ, type Farcaster as aR, type Passkey as aS, type LoginMethodOrderOption as aT, type CustomAuthFlowState as aa, type TelegramAuthFlowState as ab, type TypedMessage as ac, type MessageTypes as ad, type SmartWallet as ae, type MoonpayConfig as af, type MoonpayCurrencyCode as ag, type MoonpayPaymentMethod as ah, type Quantity as ai, type TransactionLog as aj, type TransactionReceipt as ak, type NonEmptyArray as al, type EmailWithMetadata as am, type PhoneWithMetadata as an, type WalletWithMetadata as ao, type Google as ap, type Twitter as aq, type Discord as ar, type Github as as, type LinkedIn as at, type Apple as au, type Tiktok as av, type Telegram as aw, type CrossAppAccount as ax, type LinkedAccountType as ay, type GoogleOAuthWithMetadata as az, type LinkedAccountWithMetadata as b, type BaseConnectedSolanaWallet as c, type UserRecoveryMethod as d, type SupportedSolanaTransaction as e, type SolanaCluster as f, type CreateWalletOptions as g, type SendTransactionModalUIOptions as h, type SignMessageModalUIOptions as i, type SolanaFundingConfig as j, SolanaWalletConnector as k, type WalletClientType as l, type PrivyFarcasterSignerInitResponse as m, type MfaSubmitArgs as n, type SolanaRpcRequestType as o, type EthereumRpcResponseType as p, type SolanaRpcResponseType as q, type PrivyClientConfig as r, type EIP1193Provider as s, toSolanaWalletConnectors as t, type EntropyIdVerifier as u, type RequestArguments as v, WalletTimeoutError as w, WalletConnector as x, type ConnectedWalletMetadata as y, type ConnectorType as z };
1969
+ export { type SiweWalletMetadata as $, type WalletListEntry as A, type BaseConnectedEthereumWallet as B, type ConnectedSolanaWallet as C, type ExternalWalletsConfig as D, type EthereumRpcRequestType as E, type FundingMethod as F, type BaseConnectedWallet as G, type ConnectWalletModalOptions as H, type LoginModalOptions as I, type SetWalletRecoveryOptions as J, type SignTypedDataParams as K, type LoginToFrame as L, type MfaMethod as M, type UnsignedTransactionRequest as N, type OAuthTokens as O, PrivyErrorCode as P, type FundWalletConfig as Q, type RuntimeLoginOverridableOptions as R, type SolanaTransactionReceipt as S, type ConnectedWallet as T, type User as U, type CrossAppProviderDetails as V, type Wallet as W, type OAuthProviderType as X, type MoonpaySignRequest as Y, type MoonpaySignResponse as Z, type SmartWalletConfig as _, type LoginMethod as a, type TelegramAuthResult as a0, type TelegramWebAppData as a1, type OAuthUserInfo as a2, type OAuthFlowState as a3, type LoginWithCode as a4, type OtpFlowState as a5, type PasskeyFlowState as a6, type SiweFlowState as a7, type UnsignedTransactionRequestWithChainId as a8, type BaseConnectedWalletType as a9, type DiscordOAuthWithMetadata as aA, type GithubOAuthWithMetadata as aB, type TiktokOAuthWithMetadata as aC, type LinkedInOAuthWithMetadata as aD, type AppleOAuthWithMetadata as aE, type FarcasterWithMetadata as aF, type TelegramWithMetadata as aG, type CrossAppAccountWithMetadata as aH, type PasskeyWithMetadata as aI, type Email as aJ, type Phone as aK, type TransactionUIOptions as aL, type ContractUIOptions as aM, type NativeFundingConfig as aN, type MoonpayFundingConfig as aO, type PriceDisplayOptions as aP, type Farcaster as aQ, type Passkey as aR, type LoginMethodOrderOption as aS, type TelegramAuthFlowState as aa, type TypedMessage as ab, type MessageTypes as ac, type SmartWallet as ad, type MoonpayConfig as ae, type MoonpayCurrencyCode as af, type MoonpayPaymentMethod as ag, type Quantity as ah, type TransactionLog as ai, type TransactionReceipt as aj, type NonEmptyArray as ak, type EmailWithMetadata as al, type PhoneWithMetadata as am, type WalletWithMetadata as an, type Google as ao, type Twitter as ap, type Discord as aq, type Github as ar, type LinkedIn as as, type Apple as at, type Tiktok as au, type Telegram as av, type CrossAppAccount as aw, type LinkedAccountType as ax, type GoogleOAuthWithMetadata as ay, type TwitterOAuthWithMetadata as az, type LinkedAccountWithMetadata as b, type BaseConnectedSolanaWallet as c, type UserRecoveryMethod as d, type SupportedSolanaTransaction as e, type SolanaCluster as f, type CreateWalletOptions as g, type SendTransactionModalUIOptions as h, type SignMessageModalUIOptions as i, type SolanaFundingConfig as j, SolanaWalletConnector as k, type WalletClientType as l, type PrivyFarcasterSignerInitResponse as m, type MfaSubmitArgs as n, type SolanaRpcRequestType as o, type EthereumRpcResponseType as p, type SolanaRpcResponseType as q, type PrivyClientConfig as r, type EIP1193Provider as s, toSolanaWalletConnectors as t, type EntropyIdVerifier as u, type RequestArguments as v, WalletTimeoutError as w, WalletConnector as x, type ConnectedWalletMetadata as y, type ConnectorType as z };
@@ -1195,6 +1195,7 @@ interface PrivyClientConfig {
1195
1195
  };
1196
1196
  /**
1197
1197
  * This property is only required for apps that use a third-party authentication provider.
1198
+ * @deprecated Use the `useSyncJwtBasedAuthState` hook instead.
1198
1199
  */
1199
1200
  customAuth?: {
1200
1201
  /**
@@ -1203,12 +1204,15 @@ interface PrivyClientConfig {
1203
1204
  * Defaults to true.
1204
1205
  *
1205
1206
  * @default true
1207
+ * @deprecated Use the `useSyncJwtBasedAuthState` hook instead.
1206
1208
  */
1207
1209
  enabled?: boolean;
1208
1210
  /**
1209
1211
  * A callback that returns the user's custom auth provider's access token as a string.
1210
1212
  * Can be left blank if using cookies to store and send access tokens
1211
1213
  *
1214
+ * @deprecated Use the `useSyncJwtBasedAuthState` hook instead.
1215
+ *
1212
1216
  * @example
1213
1217
  * const {getAccessTokenSilently} = useAuth();
1214
1218
  *
@@ -1225,6 +1229,8 @@ interface PrivyClientConfig {
1225
1229
  /**
1226
1230
  * Custom auth providers loading state
1227
1231
  *
1232
+ * @deprecated Use the `useSyncJwtBasedAuthState` hook instead.
1233
+ *
1228
1234
  * @example
1229
1235
  * const {isLoading} = useAuth();
1230
1236
  *
@@ -1823,18 +1829,6 @@ type CrossAppProviderDetails = {
1823
1829
  name: string;
1824
1830
  icon_url: string | null;
1825
1831
  };
1826
- type CustomAuthFlowState = {
1827
- status: 'initial';
1828
- } | {
1829
- status: 'loading';
1830
- } | {
1831
- status: 'not-enabled';
1832
- } | {
1833
- status: 'done';
1834
- } | {
1835
- status: 'error';
1836
- error: Error | null;
1837
- };
1838
1832
  type LoginToFrame = {
1839
1833
  /**
1840
1834
  * The message the Farcaster wallet signed
@@ -1972,4 +1966,4 @@ type EthereumRpcResponseType = eth_signTransactionResponse | eth_populateTransac
1972
1966
  type SolanaRpcRequestType = solana_signMessage;
1973
1967
  type SolanaRpcResponseType = solana_signMessageResponse;
1974
1968
 
1975
- export { type SiweWalletMetadata as $, type WalletListEntry as A, type BaseConnectedEthereumWallet as B, type ConnectedSolanaWallet as C, type ExternalWalletsConfig as D, type EthereumRpcRequestType as E, type FundingMethod as F, type BaseConnectedWallet as G, type ConnectWalletModalOptions as H, type LoginModalOptions as I, type SetWalletRecoveryOptions as J, type SignTypedDataParams as K, type LoginToFrame as L, type MfaMethod as M, type UnsignedTransactionRequest as N, type OAuthTokens as O, PrivyErrorCode as P, type FundWalletConfig as Q, type RuntimeLoginOverridableOptions as R, type SolanaTransactionReceipt as S, type ConnectedWallet as T, type User as U, type CrossAppProviderDetails as V, type Wallet as W, type OAuthProviderType as X, type MoonpaySignRequest as Y, type MoonpaySignResponse as Z, type SmartWalletConfig as _, type LoginMethod as a, type TelegramAuthResult as a0, type TelegramWebAppData as a1, type OAuthUserInfo as a2, type OAuthFlowState as a3, type LoginWithCode as a4, type OtpFlowState as a5, type PasskeyFlowState as a6, type SiweFlowState as a7, type UnsignedTransactionRequestWithChainId as a8, type BaseConnectedWalletType as a9, type TwitterOAuthWithMetadata as aA, type DiscordOAuthWithMetadata as aB, type GithubOAuthWithMetadata as aC, type TiktokOAuthWithMetadata as aD, type LinkedInOAuthWithMetadata as aE, type AppleOAuthWithMetadata as aF, type FarcasterWithMetadata as aG, type TelegramWithMetadata as aH, type CrossAppAccountWithMetadata as aI, type PasskeyWithMetadata as aJ, type Email as aK, type Phone as aL, type TransactionUIOptions as aM, type ContractUIOptions as aN, type NativeFundingConfig as aO, type MoonpayFundingConfig as aP, type PriceDisplayOptions as aQ, type Farcaster as aR, type Passkey as aS, type LoginMethodOrderOption as aT, type CustomAuthFlowState as aa, type TelegramAuthFlowState as ab, type TypedMessage as ac, type MessageTypes as ad, type SmartWallet as ae, type MoonpayConfig as af, type MoonpayCurrencyCode as ag, type MoonpayPaymentMethod as ah, type Quantity as ai, type TransactionLog as aj, type TransactionReceipt as ak, type NonEmptyArray as al, type EmailWithMetadata as am, type PhoneWithMetadata as an, type WalletWithMetadata as ao, type Google as ap, type Twitter as aq, type Discord as ar, type Github as as, type LinkedIn as at, type Apple as au, type Tiktok as av, type Telegram as aw, type CrossAppAccount as ax, type LinkedAccountType as ay, type GoogleOAuthWithMetadata as az, type LinkedAccountWithMetadata as b, type BaseConnectedSolanaWallet as c, type UserRecoveryMethod as d, type SupportedSolanaTransaction as e, type SolanaCluster as f, type CreateWalletOptions as g, type SendTransactionModalUIOptions as h, type SignMessageModalUIOptions as i, type SolanaFundingConfig as j, SolanaWalletConnector as k, type WalletClientType as l, type PrivyFarcasterSignerInitResponse as m, type MfaSubmitArgs as n, type SolanaRpcRequestType as o, type EthereumRpcResponseType as p, type SolanaRpcResponseType as q, type PrivyClientConfig as r, type EIP1193Provider as s, toSolanaWalletConnectors as t, type EntropyIdVerifier as u, type RequestArguments as v, WalletTimeoutError as w, WalletConnector as x, type ConnectedWalletMetadata as y, type ConnectorType as z };
1969
+ export { type SiweWalletMetadata as $, type WalletListEntry as A, type BaseConnectedEthereumWallet as B, type ConnectedSolanaWallet as C, type ExternalWalletsConfig as D, type EthereumRpcRequestType as E, type FundingMethod as F, type BaseConnectedWallet as G, type ConnectWalletModalOptions as H, type LoginModalOptions as I, type SetWalletRecoveryOptions as J, type SignTypedDataParams as K, type LoginToFrame as L, type MfaMethod as M, type UnsignedTransactionRequest as N, type OAuthTokens as O, PrivyErrorCode as P, type FundWalletConfig as Q, type RuntimeLoginOverridableOptions as R, type SolanaTransactionReceipt as S, type ConnectedWallet as T, type User as U, type CrossAppProviderDetails as V, type Wallet as W, type OAuthProviderType as X, type MoonpaySignRequest as Y, type MoonpaySignResponse as Z, type SmartWalletConfig as _, type LoginMethod as a, type TelegramAuthResult as a0, type TelegramWebAppData as a1, type OAuthUserInfo as a2, type OAuthFlowState as a3, type LoginWithCode as a4, type OtpFlowState as a5, type PasskeyFlowState as a6, type SiweFlowState as a7, type UnsignedTransactionRequestWithChainId as a8, type BaseConnectedWalletType as a9, type DiscordOAuthWithMetadata as aA, type GithubOAuthWithMetadata as aB, type TiktokOAuthWithMetadata as aC, type LinkedInOAuthWithMetadata as aD, type AppleOAuthWithMetadata as aE, type FarcasterWithMetadata as aF, type TelegramWithMetadata as aG, type CrossAppAccountWithMetadata as aH, type PasskeyWithMetadata as aI, type Email as aJ, type Phone as aK, type TransactionUIOptions as aL, type ContractUIOptions as aM, type NativeFundingConfig as aN, type MoonpayFundingConfig as aO, type PriceDisplayOptions as aP, type Farcaster as aQ, type Passkey as aR, type LoginMethodOrderOption as aS, type TelegramAuthFlowState as aa, type TypedMessage as ab, type MessageTypes as ac, type SmartWallet as ad, type MoonpayConfig as ae, type MoonpayCurrencyCode as af, type MoonpayPaymentMethod as ag, type Quantity as ah, type TransactionLog as ai, type TransactionReceipt as aj, type NonEmptyArray as ak, type EmailWithMetadata as al, type PhoneWithMetadata as am, type WalletWithMetadata as an, type Google as ao, type Twitter as ap, type Discord as aq, type Github as ar, type LinkedIn as as, type Apple as at, type Tiktok as au, type Telegram as av, type CrossAppAccount as aw, type LinkedAccountType as ax, type GoogleOAuthWithMetadata as ay, type TwitterOAuthWithMetadata as az, type LinkedAccountWithMetadata as b, type BaseConnectedSolanaWallet as c, type UserRecoveryMethod as d, type SupportedSolanaTransaction as e, type SolanaCluster as f, type CreateWalletOptions as g, type SendTransactionModalUIOptions as h, type SignMessageModalUIOptions as i, type SolanaFundingConfig as j, SolanaWalletConnector as k, type WalletClientType as l, type PrivyFarcasterSignerInitResponse as m, type MfaSubmitArgs as n, type SolanaRpcRequestType as o, type EthereumRpcResponseType as p, type SolanaRpcResponseType as q, type PrivyClientConfig as r, type EIP1193Provider as s, toSolanaWalletConnectors as t, type EntropyIdVerifier as u, type RequestArguments as v, WalletTimeoutError as w, WalletConnector as x, type ConnectedWalletMetadata as y, type ConnectorType as z };
package/dist/dts/ui.d.mts CHANGED
@@ -1,5 +1,5 @@
1
1
  import * as react_jsx_runtime from 'react/jsx-runtime';
2
- import { R as RuntimeLoginOverridableOptions } from './types-Cq3xKsys.js';
2
+ import { R as RuntimeLoginOverridableOptions } from './types-B92M8x5e.js';
3
3
  import { Hex } from 'viem';
4
4
  import { Chain, Cluster } from '@privy-io/js-sdk-core';
5
5
  import '@solana/wallet-adapter-base';
package/dist/dts/ui.d.ts CHANGED
@@ -1,5 +1,5 @@
1
1
  import * as react_jsx_runtime from 'react/jsx-runtime';
2
- import { R as RuntimeLoginOverridableOptions } from './types-Cq3xKsys.js';
2
+ import { R as RuntimeLoginOverridableOptions } from './types-B92M8x5e.js';
3
3
  import { Hex } from 'viem';
4
4
  import { Chain, Cluster } from '@privy-io/js-sdk-core';
5
5
  import '@solana/wallet-adapter-base';
@@ -1,5 +1,5 @@
1
1
  import { Chain } from '@privy-io/js-sdk-core';
2
- import { P as PrivyErrorCode, U as User, a as LoginMethod, b as LinkedAccountWithMetadata, B as BaseConnectedEthereumWallet, c as BaseConnectedSolanaWallet, W as Wallet, M as MfaMethod, d as UserRecoveryMethod, S as SolanaTransactionReceipt, e as SupportedSolanaTransaction, O as OAuthTokens, F as FundingMethod, f as SolanaCluster, C as ConnectedSolanaWallet, g as CreateWalletOptions } from './types-Cq3xKsys.js';
2
+ import { P as PrivyErrorCode, U as User, a as LoginMethod, b as LinkedAccountWithMetadata, B as BaseConnectedEthereumWallet, c as BaseConnectedSolanaWallet, W as Wallet, M as MfaMethod, d as UserRecoveryMethod, S as SolanaTransactionReceipt, e as SupportedSolanaTransaction, O as OAuthTokens, F as FundingMethod, f as SolanaCluster, C as ConnectedSolanaWallet, g as CreateWalletOptions } from './types-B92M8x5e.js';
3
3
  import { MouseEvent } from 'react';
4
4
 
5
5
  /**
@@ -1,5 +1,5 @@
1
1
  import { Chain } from '@privy-io/js-sdk-core';
2
- import { P as PrivyErrorCode, U as User, a as LoginMethod, b as LinkedAccountWithMetadata, B as BaseConnectedEthereumWallet, c as BaseConnectedSolanaWallet, W as Wallet, M as MfaMethod, d as UserRecoveryMethod, S as SolanaTransactionReceipt, e as SupportedSolanaTransaction, O as OAuthTokens, F as FundingMethod, f as SolanaCluster, C as ConnectedSolanaWallet, g as CreateWalletOptions } from './types-Cq3xKsys.js';
2
+ import { P as PrivyErrorCode, U as User, a as LoginMethod, b as LinkedAccountWithMetadata, B as BaseConnectedEthereumWallet, c as BaseConnectedSolanaWallet, W as Wallet, M as MfaMethod, d as UserRecoveryMethod, S as SolanaTransactionReceipt, e as SupportedSolanaTransaction, O as OAuthTokens, F as FundingMethod, f as SolanaCluster, C as ConnectedSolanaWallet, g as CreateWalletOptions } from './types-B92M8x5e.js';
3
3
  import { MouseEvent } from 'react';
4
4
 
5
5
  /**