React + Vite example using MetaMask Embedded Wallets (powered by Web3Auth) with a bring-your-own JWT backend. You issue the JWT from your own server; Web3Auth validates it via your JWKS endpoint and derives the user's wallet. Compatible with any OAuth 2.0 / OIDC-compliant identity provider.
The JWT must include an
iatclaim within 60 seconds of the current time on every login attempt, regardless ofexp.
- Node.js 20+
- npm
- A Client ID from the Dashboard
- Your own JWT issuer with a publicly accessible JWKS endpoint
- A custom JWT connection configured on the Dashboard (Custom JWT guide)
git clone https://github.com/Web3Auth/web3auth-examples.git
cd web3auth-examples/custom-authentication/single-connection/custom-jwt-examplenpm installcp .env.example .envEdit .env:
VITE_WEB3AUTH_CLIENT_ID=YOUR_CLIENT_ID
npm run devVisit http://localhost:5173 in your browser.
MIT