@web5nexus/authmodal-web3auth
v0.2.5
Published
Web5 Nexus Auth Modal — Web3Auth adapter (BYOK clientId)
Readme
@web5nexus/authmodal-web3auth
Web3Auth adapter for Web5 Auth Modal. Uses Web3Auth NoModal + Auth connector only (social login) — no MetaMask / injected wallet UI.
Install
npm install @web5nexus/authmodal-web3auth @web5nexus/authmodal-core@web3auth/modal (and browser polyfill deps) ship with this package — hosts do not need to install Web3Auth separately.
What it does
- Factory
web3auth(options)→SocialWalletAdapter - BYOK: your Web3Auth
clientIdand network (sapphire_devnet/sapphire_mainnet) - Optional
rpcUrl(e.g. ChainRouter URL) as the EVM provider RPC target - Supports private-key export for Bitcoin derivation when configured
Usage
// App entry — before any Web3Auth import
import '@web5nexus/authmodal-web3auth/polyfill'
import { web3auth } from '@web5nexus/authmodal-web3auth'
import { chainRouterRpcUrl } from '@web5nexus/authmodal-core'
const adapter = web3auth({
clientId: process.env.W3A_CLIENT_ID!,
network: 'sapphire_devnet',
rpcUrl: chainRouterRpcUrl(1, process.env.CHAINROUTER_API_KEY!),
})Vite helpers
import {
web3authViteAliases,
web3authOptimizeDeps,
} from '@web5nexus/authmodal-web3auth/vite'
export default defineConfig({
resolve: { alias: [...web3authViteAliases()] },
optimizeDeps: web3authOptimizeDeps(),
})Dashboard checklist
- Create a project at Web3Auth Dashboard
- Copy Client ID
- Add your app origins / redirect URLs
- Prefer Auth / social login only (this adapter does not open the full Web3Auth wallet modal)
License
MIT — Web5 Nexus Team
