Skip to content

Repository files navigation

MetaMask Embedded Wallets — Examples

MetaMask Embedded Wallets (powered by Web3Auth) provides non-custodial social login wallets using threshold key cryptography. Users authenticate with OAuth or custom JWT providers and receive a deterministic, self-custodied wallet — no seed phrase required.

This repository contains ready-to-run examples across frameworks, blockchains, and authentication providers.

Prerequisites

  • Node.js 22.12+
  • npm
  • A Client ID from the Dashboard

Use Sapphire Devnet for local development (allows localhost). Switch to Sapphire Mainnet only when deploying to production.

Quick Setup

git clone https://github.com/Web3Auth/web3auth-examples.git
cd web3auth-examples/<example-directory>
cp .env.example .env          # add your Client ID
npm install
npm start                     # or npm run dev / npm run serve

Example Directory

Quick Starts

The fastest way to get a working integration for your framework.

Framework Example Chain SDK Doc
React react-quick-start EVM React SDK
React (No-Modal) react-no-modal-quick-start EVM React SDK
React + Solana react-solana-quick-start Solana React SDK
Next.js nextjs-quick-start EVM React SDK
Vue.js vue-quick-start EVM Vue SDK
Vue.js + Solana vue-solana-quick-start Solana Vue SDK
Angular angular-quick-start EVM JavaScript SDK
Vanilla JS vanillajs-quick-start EVM JavaScript SDK

Custom Authentication — Single Connection

Each example wires one external identity provider to a dedicated Web3Auth connection. Set up your connection on the Dashboard before running.

Provider Example Auth Flow Dashboard Guide
Google (OAuth) google-implicit-example Implicit Google
Google One Tap google-one-tap-example Implicit Google
Facebook facebook-implicit-example Implicit Authentication
Discord discord-implicit-example Implicit Authentication
Twitch twitch-implicit-example Implicit Authentication
Worldcoin worldcoin-implicit-example Implicit Authentication
Auth0 (Implicit) auth0-implicit-example Implicit Auth0
Auth0 (JWT) auth0-jwt-example JWT Auth0
AWS Cognito cognito-implicit-example Implicit Cognito
Firebase firebase-jwt-example JWT Firebase
Custom JWT custom-jwt-example JWT Custom JWT
Modal (default) modal-example Modal Dashboard

Custom Authentication — Grouped Connections

Grouped connections let multiple login methods resolve to the same wallet address for a user. Essential for apps that offer both social login and email passwordless login.

Providers Example Guide
Auth0 + Google (Implicit) auth0-google-implicit-grouped-example Grouped Connections
Auth0 + Google (JWT) auth0-google-jwt-grouped-example Grouped Connections
Firebase + Google (JWT) firebase-google-jwt-grouped-example Grouped Connections
Google + Email Passwordless (Modal) modal-google-email-passwordless-grouped-example Grouped Connections

Other — Chains & Advanced Features

Example Description Docs
algorand-example Sign transactions on Algorand —
aptos-example Interact with the Aptos Move blockchain —
bitcoin-example Sign Bitcoin transactions —
cosmos-example Interact with Cosmos SDK chains —
multi-chain-example Operate Ethereum, Solana, Tezos, and Polkadot in one session —
polkadot-example Sign transactions on Polkadot/Substrate —
polymesh-example Interact with the Polymesh security token network —
starknet-example Interact with StarkNet (Ethereum L2) —
sui-example Sign transactions on Sui —
tezos-example Sign transactions on Tezos —
ton-example Interact with TON (Telegram Open Network) —
tron-example Sign transactions on TRON —
xrpl-example Interact with the XRP Ledger —
smart-account-example Send EVM transactions via Wagmi with Web3Auth as the signer Smart Accounts
server-side-verification-example Verify a Web3Auth id_token on your Next.js backend Server-Side Verification
solana-pay-example Solana Pay QR-code payment requests with Web3Auth Solana
sns-example Solana Name Service (SNS) resolution Solana
sign-protocol-example On-chain attestations on Sepolia via Sign Protocol —
xmtp-example Decentralised messaging with XMTP —

Build with AI

Speed up integrations by giving your AI coding assistant access to the documentation and SDK reference.

Skill (guides SDK selection, auth concepts, and common pitfalls):

npx skills add web3auth/skill

MCP server (live docs, examples, and SDK types). Add to Cursor or Claude Code:

{
  "mcpServers": {
    "web3auth": {
      "url": "https://mcp.web3auth.io"
    }
  }
}

Static docs (for tools without MCP support):

  • Full snapshot: https://docs.metamask.io/llms-embedded-wallets-full.txt
  • Index: https://docs.metamask.io/llms-embedded-wallets.txt

See the full Build with AI guide for per-agent setup.


Resources

License

MIT

Releases

Packages

Used by

Contributors

Languages