UNPKG

@turnkey/react-wallet-kit

Version:

The easiest and most powerful way to integrate Turnkey's Embedded Wallets into your React applications.

39 lines 2.13 kB
import { ReactNode } from "react"; import { type TurnkeyCallbacks, type TurnkeyProviderConfig } from "../../types/base"; /** * @inline */ interface ClientProviderProps { children: ReactNode; config: TurnkeyProviderConfig; callbacks?: TurnkeyCallbacks | undefined; } /** * Provides Turnkey client authentication, session management, wallet operations, and user profile management * for the React Wallet Kit SDK. This context provider encapsulates all core authentication flows (Passkey, Wallet, OTP, OAuth), * session lifecycle (creation, expiration, refresh), wallet connecting/import/export, and user profile updates (email, phone, name). * * The provider automatically initializes the Turnkey client, fetches configuration (including proxy auth config if needed), * and synchronizes session and authentication state. It exposes a comprehensive set of methods for authentication flows, * wallet management, and user profile operations, as well as UI handlers for modal-driven flows. * * Features: * - Passkey, Wallet, OTP (Email/SMS), and OAuth (Google, Apple, Facebook, X, Discord) authentication and sign-up flows. * - Session management: creation, expiration scheduling, refresh, and clearing. * - Wallet management: fetch, connect, import, export, account management. * - User profile management: email, phone, name, OAuth provider, and passkey linking/removal. * - Modal-driven UI flows for authentication, wallet connecting, and profile updates. * - Error handling and callback integration for custom error and event responses. * * Usage: * Wrap your application with `TurnkeyProvider` to enable authentication and wallet features via context. * * @param config - The Turnkey provider configuration object. * @param children - React children to be rendered within the provider. * @param callbacks - Optional callbacks for error handling and session events. * * @returns A React context provider exposing authentication, wallet, and user management methods and state. */ export declare const ClientProvider: React.FC<ClientProviderProps>; export {}; //# sourceMappingURL=Provider.d.ts.map