@lit-protocol/login-modal is currently experimental and focuses on a minimal, modular API. Expect breaking changes as it hardens.
Install
Quickstart
Wrap your app with LitAuthProvider, then call showAuthModal() when you want to prompt login.
Auth services (required for non-EOA methods)
If you enable any auth method other than eoa, you must provide:
services.authServiceUrls (per network)
services.loginServerUrl (Google/Discord)
services.discordClientId (Discord)
EOA wallet provider integration (RainbowKit / Wagmi, etc.)
By default, the EOA flow uses window.ethereum. If your app uses a wallet framework (Wagmi, WalletConnect, custom EIP-1193 provider), pass an EOA wallet provider so the modal can authenticate with the already connected wallet client.
Any EIP-1193 provider (WalletConnect / Web3Modal / Privy / Dynamic, etc.)
If your connection layer gives you an EIP-1193 provider, you can adapt it to the modal using createEoaWalletProvider.
Minting PKPs (EOA vs Auth Service)
- EOA (
enabledAuthMethods includes eoa): minting is on-chain by default (no Auth Service). The user’s connected wallet signs the transaction, so it must have gas / test tokens.
- Optional: if you run an Auth Service, the modal can also do a sponsored mint via
POST /pkp/mint (useful when the user has no gas). This requires services.authServiceUrls (and services.authServiceApiKey if your Auth Service gates requests).
- Non-EOA methods (Google/Discord/WebAuthn/Stytch, etc.): minting happens via the Auth Service (
POST /pkp/mint), so you must provide services.authServiceUrls (and any required API key configuration).
Custom UI
Use components to override specific parts of the modal:
components.PkpSelection: replace the default PKP selection UI
components.FundingPanel: replace the default Ledger funding UI
This is how the Explorer app customises the PKP selection and funding experiences.