LazorKitProvider
Provider component — initialises config, RPC, and the wallet store.
Wrap your app once at the root with LazorKitProvider. It sets up the Zustand store,
builds the Connection, installs Buffer polyfills, and holds the portal / paymaster config.
import { LazorKitProvider } from '@lazorkit/wallet-mobile-adapter';Minimum setup
<LazorKitProvider>
<App />
</LazorKitProvider>Devnet defaults
With no props, the provider connects to Solana Devnet through portal.lazor.sh and the
public Kora paymaster at kora.devnet.lazorkit.com. Perfect for demos and local development.
Production setup
<LazorKitProvider
rpcUrl={process.env.EXPO_PUBLIC_RPC_URL}
portalUrl="https://portal.lazor.sh"
configPaymaster={{
paymasterUrl: process.env.EXPO_PUBLIC_PAYMASTER_URL!,
apiKey: process.env.EXPO_PUBLIC_PAYMASTER_KEY,
}}
rpId="portal.lazor.sh"
isDebug={__DEV__}
>
<App />
</LazorKitProvider>Props
| Prop | Type | Default | Required |
|---|---|---|---|
rpcUrl | string | https://api.devnet.solana.com | no |
portalUrl | string | https://portal.lazor.sh | no |
configPaymaster | { paymasterUrl: string; apiKey?: string } | Devnet Kora | no |
rpId | string | portal.lazor.sh | no |
isDebug | boolean | false | no |
children | ReactNode | — | yes |
Prop details
rpId must match
rpId is the WebAuthn Relying Party ID baked into each passkey at registration time.
Changing it between connect calls invalidates existing passkeys. Keep it stable in
production.
rpcUrl— Any Solana RPC. Falsy values fall back to the Devnet default.portalUrl— The WebAuthn-enabled web page the SDK opens viaexpo-web-browser. Self-hosters can point this at their own portal.configPaymaster— Kora JSON-RPC endpoint.apiKeyis sent asx-api-keyon every request.isDebug— Enables verbose logs via the built-inlogger.
Recipes
Switch networks at runtime
const [network, setNetwork] = useState<'devnet' | 'mainnet'>('devnet');
const rpcUrl = network === 'devnet'
? 'https://api.devnet.solana.com'
: 'https://api.mainnet-beta.solana.com';
return (
<LazorKitProvider rpcUrl={rpcUrl}>
<App />
</LazorKitProvider>
);Changing rpcUrl recreates the Connection. The persisted wallet record is untouched — it
continues to work on whichever cluster holds the on-chain wallet account.
Hide behind an env-driven config
const isProd = !__DEV__;
<LazorKitProvider
rpcUrl={isProd
? process.env.EXPO_PUBLIC_MAINNET_RPC!
: 'https://api.devnet.solana.com'}
configPaymaster={{
paymasterUrl: isProd
? process.env.EXPO_PUBLIC_MAINNET_PAYMASTER!
: 'https://kora.devnet.lazorkit.com',
}}
>
<App />
</LazorKitProvider>Runtime notes
- Memoizes the
ConnectiononrpcUrl, so rebuilds are cheap. - Persists
{ wallet, config }toAsyncStorageunder keylazor-wallet-store. - Runs a state migration on v0 → v1 to move
smartWalletfrom the wallet PDA to the vault PDA. Users who connected before v2 keep their wallet transparently.