Archived Content from Web3Auth Community
This topic was originally posted by aman.sharma on 5/26/2025.
This content has been migrated from our previous community forum to preserve valuable discussions.
async function initSNS() {
try {
const chainTestnetConfig = {
chainNamespace: CHAIN_NAMESPACES.EIP155,
chainId: numberToHexadecimal(process.env.NEXT_PUBLIC_CHAINID_ETH),
rpcTarget:
“https://sepolia.infura.io/v3/68026010151145c9b2de3c9889f09067”,
displayName: “Arbitrum Testnet”,
blockExplorer: “”,
ticker: “ETH”,
tickerName: “ETH”,
};
const chainMainnetConfig = {
chainNamespace: CHAIN_NAMESPACES.EIP155,
chainId: numberToHexadecimal(process.env.NEXT_PUBLIC_CHAINID_XANA), // Please use 0x1 for Mainnet
rpcTarget: “https://mainnet.xana.net/rpc”,
displayName: “XANAChain”,
blockExplorer: “https://xanachain.xana.net/”,
ticker: “XETA”,
tickerName: “XANAChain”,
};
const chainConfig =
process.env.NEXT_PUBLIC_NETWORK_TYPE === “testnet”
? chainTestnetConfig
: chainMainnetConfig;
const Testnetid =
// “BMwTnf6I4qw7qwOWP1J1BsgHKEZDGG0peo-DpCMBmurc1RUSY16Ag8LdC4on55hLiStTQxm0FJ2wOuIZU2m9gr0”; //testnet
"BFgUBN9g6h-PT5NIJo7RdU_05NnXkGZ4b7-H_W2eOGNVtjyWev96SmrwON3MG8bLpI0Oayuw3RziCHWDpZQlYGc"; //testnet const id = "BN6IUMdXOI0xnRvw6um4CW225E_9DbLhtjnbOGwoL-DkTFUke8IwUehNhlqUHn5JyefNIaWfzr_PLTpF4cmNWbQ" // "BPnWnv68o43X4uLNUNrBEWgu6GgletwK5bOU4SLpHFrKrkATivj36lOX3B1DE7u3qeFTksKqK30arrFLYAzAgGY"; //mainnet const web3auth = new Web3AuthNoModal({ clientId: process.env.NEXT_PUBLIC_NETWORK_TYPE === "testnet" ? Testnetid : id, chainConfig, // web3AuthNetwork: 'testnet', //testnet web3AuthNetwork: process.env.NEXT_PUBLIC_NETWORK_TYPE === "testnet" ? "sapphire_devnet" : "sapphire_mainnet", //mainnet useCoreKitKey: false, });const privateKeyProvider:any = new EthereumPrivateKeyProvider({
config: { chainConfig },
});const openloginAdapter :any= new OpenloginAdapter({
loginSettings: {
mfaLevel: “none”, // Pass on the mfa level of your choice: default, optional, mandatory, none
},
adapterSettings: {
clientId: id,sessionTime: 86400 * 7, loginConfig: { // Telegram login jwt: { verifier: "xana-testnet", verifierSubIdentifier: "telegram", typeOfLogin: "jwt", clientId: id, }, // telegram : { // // verifier: 'ppp-social-login-2', // testnet // verifier: // process.env.NEXT_PUBLIC_NETWORK_TYPE === "testnet" // ? "xana-testnet" // : "social-aggregate-verifier", //mainnet // verifierSubIdentifier: "telegram", // Pass the Sub-Verifier here. eg w3a-google // typeOfLogin: "jwt", // Pass the type of login provider. // // clientId: '792163717588-h9t0is3ng39opqmt1meflma087ov18k3.apps.googleusercontent.com', // testnet // // clientId:Testnetid // // process.env.NEXT_PUBLIC_NETWORK_TYPE === "testnet" // // ? "792163717588-h9t0is3ng39opqmt1meflma087ov18k3.apps.googleusercontent.com" // // : "1041808867611-576ma9t6bva7b94irmvbt88n02tvoujn.apps.googleusercontent.com", //mainnet // }, // Google login google: { // verifier: 'ppp-social-login-2', // testnet verifier: process.env.NEXT_PUBLIC_NETWORK_TYPE === "testnet" ? "xana-testnet" : "social-aggregate-verifier", //mainnet verifierSubIdentifier: "google", // Pass the Sub-Verifier here. eg w3a-google typeOfLogin: "google", // Pass the type of login provider. // clientId: '792163717588-h9t0is3ng39opqmt1meflma087ov18k3.apps.googleusercontent.com', // testnet clientId: process.env.NEXT_PUBLIC_NETWORK_TYPE === "testnet" ? "883163088578-eqsl00u5n7tga1vl4iaf3dp8quq341k8.apps.googleusercontent.com" : "1041808867611-576ma9t6bva7b94irmvbt88n02tvoujn.apps.googleusercontent.com", //mainnet }, line: { verifier: 'xana-testnet', // verifierSubIdentifier: 'ppp-line', typeOfLogin: 'jwt', clientId: 'yrs3b6Z87XW9c48rJ2UqF3Kz5cLCfO9Z', },// line: {
// verifier: “YOUR_VERIFIER_NAME”, // Verifier name from your Web3Auth dashboard
// typeOfLogin: “jwt”, // Always “jwt” for Auth0
// clientId: “YOUR_AUTH0_CLIENT_ID”, // Auth0 Client ID for your Auth0 application
// },apple: { // verifier: 'ppp-social-login-2', //testnet verifier: process.env.NEXT_PUBLIC_NETWORK_TYPE === "testnet" ? "xana-testnet" : "social-aggregate-verifier", //mainnet verifierSubIdentifier: "apple", typeOfLogin: "jwt", // clientId: 'QRQW2fY3167OZTzreWBqHTBQU7gGXUD0', //testnet clientId: process.env.NEXT_PUBLIC_NETWORK_TYPE === "testnet" ? "QRQW2fY3167OZTzreWBqHTBQU7gGXUD0" : "bJgmFBdg8eSa2gAzh1yv3ABinO9NIq1z", //mainnet }, // emailpasswordless Login via Auth0 emailpasswordless: { verifier: process.env.NEXT_PUBLIC_NETWORK_TYPE === "testnet" ? "xana-testnet" : "social-aggregate-verifier", //mainnet verifier : "social-aggregate-verifier", //mainnet verifierSubIdentifier: "auth0pwdless", // Pass the Sub-Verifier here. eg w3a-a0-email-passwordless typeOfLogin: "jwt", // Pass the type of login provider. For Auth0, it's jwt and not Auth0. // clientId: 'kV31v4CokK8xEHgNcHki1nAVDCh3Friu', // testnet clientId: process.env.NEXT_PUBLIC_NETWORK_TYPE === "testnet" ? "kV31v4CokK8xEHgNcHki1nAVDCh3Friu" : "fr46GR3TzfOJFNvgEcIcQKLtLi48cm3c", }, },
},
privateKeyProvider,
});
web3auth.configureAdapter(openloginAdapter);
(window as any).Web3Auth = web3auth;
await web3auth.init();
(window as any).Web3AuthProvider = web3auth.provider;
} catch (error) {
console.error(error);
}
}
async function loginWithLine() {
try {
const { Web3Auth } = window as any;
const web3authProvider = await Web3Auth.connectTo(“openlogin”, {
redirectUrl :“http://localhost:3000/mamamia”,
loginProvider: “line”,
extraLoginOptions: {
domain: “https://dev-05dkqxcijmqnze5g.us.auth0.com”, // Pass the Auth0 Domain here, eg. https://web3auth.au.auth0.com
// This corresponds to the field inside jwt which must be used to uniquely identify the user.
verifierIdField: "Line", // This is mapped b/w google and github logins.
isVerifierIdCaseSensitive: false,
connection: "line",
},
});
(window as any).Web3AuthProvider = web3authProvider;
} catch (error) {
console.error(error);
}
}
When we enter login cred in line after that in web3auth facing the error of cannot read properties of undefined to lowercase

