When asking for help in this category, please make sure to provide the following details:
- SDK Version(package.json):
"@magic-ext/oauth": "^22.0.7",
"@magiclabs/wagmi-connector": "2.1.0",
"@radix-ui/react-alert-dialog": "^1.1.1",
"@radix-ui/react-avatar": "^1.1.0",
"@radix-ui/react-dialog": "^1.1.1",
"@radix-ui/react-dropdown-menu": "^2.1.1",
"@radix-ui/react-slot": "^1.1.0",
"@radix-ui/react-tooltip": "^1.1.2",
"@t3-oss/env-nextjs": "^0.10.1",
"@tanstack/react-query": "^5.0.0",
"@types/humanize-plus": "^1.8.2",
"@wagmi/core": "^2.6.5",
"@web3auth/base": "^9.0.2",
"@web3auth/ethereum-provider": "^9.0.2",
"@web3auth/modal": "^9.1.0",
"@web3auth/wallet-services-plugin": "^9.1.0",
"@web3auth/web3auth-wagmi-connector": "^7.0.0",
"autoprefixer": "^10.4.20",
"axios": "^1.7.7",
"class-variance-authority": "^0.7.0",
"clsx": "^2.1.1",
"humanize-plus": "^1.8.2",
"lint-staged": "^15.2.9",
"lucide-react": "^0.436.0",
"magic-sdk": "^28.0.7",
"next": "14.2.7",
"next-themes": "^0.3.0",
"react": "^18",
"react-dom": "^18",
"react-qr-code": "^2.0.15",
"tailwind-merge": "^2.5.2",
"tailwindcss-animate": "^1.0.7",
"viem": "^2.19.4",
"wagmi": "^2.12.5",
"zod": "^3.23.8"
}
-
Platform: web pnp modal
-
Browser Console Screenshots:
-
If the issue is related to Custom Authentication, please include the following information (optional):
- Verifier Name: iq-wallet
- JWKS Endpoint:
- Sample idToken (JWT):
Also, kindly provide the Web3Auth initialization and login code snippet below. This will help us better understand your issue and provide you with the necessary assistance.
import { env } from '@/env.mjs'
import { CHAIN_NAMESPACES, WEB3AUTH_NETWORK } from '@web3auth/base'
import { EthereumPrivateKeyProvider } from '@web3auth/ethereum-provider'
import { Web3Auth } from '@web3auth/modal'
import { Web3AuthConnector } from '@web3auth/web3auth-wagmi-connector'
import type { Chain } from 'wagmi/chains'
export function Web3AuthConnectorInstance(chains: Chain[]) {
const name = 'IQ Wallet'
const chainConfig = {
chainNamespace: CHAIN_NAMESPACES.EIP155,
chainId: `0x${chains[0].id.toString(16)}`,
rpcTarget: chains[0].rpcUrls.default.http[0],
displayName: chains[0].name,
tickerName: chains[0].nativeCurrency?.name,
ticker: chains[0].nativeCurrency?.symbol,
blockExplorerUrl: chains[0].blockExplorers?.default.url,
}
console.log('chainConfig', chainConfig)
const privateKeyProvider = new EthereumPrivateKeyProvider({
config: { chainConfig },
})
const web3AuthInstance = new Web3Auth({
clientId: env.NEXT_PUBLIC_WEB3AUTH_CLIENT_ID, //TODO: change to prod client id
chainConfig,
privateKeyProvider,
uiConfig: {
appName: name,
loginMethodsOrder: ['google'],
defaultLanguage: 'en',
modalZIndex: '2147483647',
logoLight: 'https://web3auth.io/images/w3a-L-Favicon-1.svg',
logoDark: 'https://web3auth.io/images/w3a-D-Favicon-1.svg',
uxMode: 'popup',
mode: 'light',
},
web3AuthNetwork: WEB3AUTH_NETWORK.SAPPHIRE_DEVNET,
useCoreKitKey: true,
enableLogging: true,
})
return Web3AuthConnector({
web3AuthInstance,
})
}
Pregeneration code
const pregenerateWeb3AuthWallet = async (verifierId: string) => {
try {
const params = new URLSearchParams({
verifier: 'iq-wallet',
verifierId: verifierId,
web3AuthNetwork: WEB3AUTH_NETWORK.SAPPHIRE_DEVNET,
clientId: env.NEXT_PUBLIC_WEB3AUTH_CLIENT_ID,
})
const response = await fetch(
`${WALLET_PREGENERATION_API}?${params.toString()}`,
)
console.log('constructed url', `${WALLET_PREGENERATION_API}?${params.toString()}`)
const data = await response.json()
if (data.success && data.data.evmAddress) {
setNewWeb3AuthAddress(data.data.evmAddress)
} else {
throw new Error('Failed to pregenerate Web3Auth wallet')
}
} catch (err) {
setError('Failed to pregenerate Web3Auth wallet')
console.error(err)
}
}
Error
hook.js:608 Error while connecting to adapter: auth WalletLoginError: useCoreKitKey flag is enabled but coreKitKey is not available
I am on saphire_devnet