@web5nexus/authmodal-magic
v0.2.3
Published
Web5 Nexus Auth Modal — Magic adapter (BYOK apiKey)
Readme
@web5nexus/authmodal-magic
Magic Link adapter for Web5 Auth Modal — email OTP and OAuth social login with bring-your-own Magic API key.
Install
npm install @web5nexus/authmodal-magic @web5nexus/authmodal-core magic-sdk @magic-ext/oauth2What it does
- Factory
magic(options)→SocialWalletAdapter - BYOK: your Magic
apiKey(publishable key) - Email and OAuth2 flows via Magic SDK
- Integrates with Auth Modal session + optional Bitcoin derivation when keys can be exported
Usage
import { magic } from '@web5nexus/authmodal-magic'
const adapter = magic({
apiKey: process.env.MAGIC_API_KEY!,
// network / rpc — default is Magic `mainnet`. Custom rpcUrl requires Magic Dashboard CSP allowlist.
// Do not pass ChainRouter URLs unless allowlisted, or you get RPC -32603.
})
// Pass into AuthModalProvider adapters: [adapter]Dashboard checklist
- Create an app at Magic Dashboard
- Copy the publishable API key
- Configure redirect URIs for OAuth providers you enable
- Add your app origins to Magic allowlists
License
MIT — Web5 Nexus Team
