Let users sign in with a Solana or Ethereum wallet by signing a message (Sign-In with Ethereum / Solana).
Turn on Solana wallets and/or Ethereum wallets in Studio → Authentication → Sign-in methods → Web3 wallets. The user signs a sign-in message in their wallet; no e-mail or password is needed, and the wallet address becomes the user's identity.
signInWithWeb3() needs stitchdb-js 1.1 or later.
JavaScript
// Solana (Phantom, Solflare, …) in the browser
const { data, error } = await stitchdb.auth.signInWithWeb3({ chain: 'solana', statement: 'Sign in to My App' })
// Ethereum (any EIP-1193 wallet, e.g. MetaMask)
await stitchdb.auth.signInWithWeb3({ chain: 'ethereum', statement: 'Sign in to My App' })The sign-in message names your Site URL's domain, and only messages for an allowed URL are accepted (see Redirect URLs). Users signed in this way have the identity provider web3.