@privy-io/react-auth 1.52.4 → 1.52.5-beta-20240108212636
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.
- package/dist/esm/index.js +194 -194
- package/dist/index.d.ts +28 -1
- package/dist/index.js +206 -206
- package/package.json +1 -1
package/dist/index.d.ts
CHANGED
|
@@ -703,6 +703,8 @@ interface ConnectorManagerEvents {
|
|
|
703
703
|
declare class ConnectorManager extends EventEmitter<ConnectorManagerEvents> {
|
|
704
704
|
walletConnectors: WalletConnector[];
|
|
705
705
|
initialized: boolean;
|
|
706
|
+
walletsReady: boolean;
|
|
707
|
+
private initializedWalletConnectors;
|
|
706
708
|
private storedConnections;
|
|
707
709
|
private activeWallet?;
|
|
708
710
|
private walletConnectCloudProjectId;
|
|
@@ -783,6 +785,8 @@ declare class PrivyClient {
|
|
|
783
785
|
authFlow?: AuthFlow;
|
|
784
786
|
mfaFlow?: MfaFlow;
|
|
785
787
|
connectors?: ConnectorManager;
|
|
788
|
+
onStoreToken?: ((token: string | null) => void) | undefined;
|
|
789
|
+
onDeleteToken?: (() => void) | undefined;
|
|
786
790
|
/**
|
|
787
791
|
* Creates a new Privy client.
|
|
788
792
|
* @param options Initialization options.
|
|
@@ -2131,6 +2135,7 @@ interface UseWalletsInterface {
|
|
|
2131
2135
|
* The user's connected wallets.
|
|
2132
2136
|
*/
|
|
2133
2137
|
wallets: ConnectedWallet[];
|
|
2138
|
+
ready: boolean;
|
|
2134
2139
|
}
|
|
2135
2140
|
declare function useWallets(): UseWalletsInterface;
|
|
2136
2141
|
|
|
@@ -2384,6 +2389,17 @@ type PrivyEvents = {
|
|
|
2384
2389
|
*/
|
|
2385
2390
|
onMfaRequired: (mfaMethods: MfaMethod[]) => void;
|
|
2386
2391
|
};
|
|
2392
|
+
accessToken: {
|
|
2393
|
+
/**
|
|
2394
|
+
* Callback that will execute when a user's access token is granted.
|
|
2395
|
+
* @param accessToken - The user's access token
|
|
2396
|
+
*/
|
|
2397
|
+
onAccessTokenGranted: (accessToken: string) => void;
|
|
2398
|
+
/**
|
|
2399
|
+
* Callback that will execute when a user's access token is removed.
|
|
2400
|
+
*/
|
|
2401
|
+
onAccessTokenRemoved: () => void;
|
|
2402
|
+
};
|
|
2387
2403
|
};
|
|
2388
2404
|
|
|
2389
2405
|
/**
|
|
@@ -2549,4 +2565,15 @@ declare const useModalStatus: () => {
|
|
|
2549
2565
|
isOpen: boolean;
|
|
2550
2566
|
};
|
|
2551
2567
|
|
|
2552
|
-
|
|
2568
|
+
/**
|
|
2569
|
+
* Use this hook to tap into access token grant and revoke events.
|
|
2570
|
+
*
|
|
2571
|
+
* @param callbacks.onAccessTokenGranted {@link PrivyEvents} callback to automatically execute when a user is granted an access token. This will be called when a user logs in, or when a user's access token is refreshed.
|
|
2572
|
+
* @param callbacks.onAccessTokenRemoved {@link PrivyEvents} callback to automatically execute when a user's access token is revoked.
|
|
2573
|
+
* @returns getAccessToken - returns the user's current access token
|
|
2574
|
+
*/
|
|
2575
|
+
declare function useToken(callbacks?: PrivyEvents['accessToken']): {
|
|
2576
|
+
getAccessToken: () => Promise<string | null>;
|
|
2577
|
+
};
|
|
2578
|
+
|
|
2579
|
+
export { Apple, AppleOAuthWithMetadata, AsExternalProvider, CallbackError, Captcha, ConnectedWallet, ConnectorManager, ContractUIOptions, Discord, DiscordOAuthWithMetadata, EIP1193Provider, Email, EmailWithMetadata, FundWalletConfig, Github, GithubOAuthWithMetadata, Google, GoogleOAuthWithMetadata, LinkedIn, LinkedInOAuthWithMetadata, LoginWithCode, MfaMethod, MoonpayConfig, MoonpayCurrencyCode, MoonpayPaymentMethod, Phone, PhoneWithMetadata, PriceDisplayOptions, PrivyClient, PrivyClientConfig, PrivyEvents, PrivyInterface, PrivyProvider, PrivyProviderProps, PrivyProxyProvider, Quantity, DEFAULT_SUPPORTED_CHAINS as SUPPORTED_CHAINS, SendCodeToEmail, SendTransactionModalUIOptions, SignMessageModalUIOptions, Tiktok, TiktokOAuthWithMetadata, TransactionLog, TransactionReceipt, TransactionUIOptions, Twitter, TwitterOAuthWithMetadata, UnsignedTransactionRequest, UseLoginWithEmail, UseWalletsInterface, User, VERSION, Wallet, WalletConnector, WalletListEntry, WalletWithMetadata, errorIndicatesMaxMfaRetries, errorIndicatesMfaTimeout, errorIndicatesMfaVerificationFailed, getAccessToken, useConnectWallet, useCreateWallet, useLogin, useLoginWithEmail, useLogout, useMfa, useMfaEnrollment, useModalStatus, usePrivy, useRegisterMfaListener, useToken, useWallets };
|