Archived Content from Web3Auth Community
This topic was originally posted by lucas.kraus on 10/16/2024.
This content has been migrated from our previous community forum to preserve valuable discussions.
When asking for help in this category, please make sure to provide the following details:
- SDK Version: 7.0.1
- Platform: React Native
- Browser Console Screenshots:
Hey everyone! Iâm currently using Expo for my project, mainly the web version. The React Native SDK integration looks great, but when I call the init() method after the setup configuration it throws an error âFailed to fetch project config: Cannot read properties of undefined (reading âdecodeâ)â
Hereâs my setup code that I did based on Web3Auth docs:
useEffect(() => { const init = async () => { await web3auth.init();if (web3auth.privKey) { await ethereumPrivateKeyProvider.setupProvider(web3auth.privKey); } }; init();}, );
const redirectUrl =
Constants.appOwnership == AppOwnership.Expo ||
Constants.appOwnership == AppOwnership.Guest
? Linking.createURL(âweb3authâ, {})
: Linking.createURL(âweb3authâ, { scheme: âweb3authexpoexampleâ });const clientId =
âBLp6-z-fTRXLQsKHPcXvITV9ckcNe1mO5kzdLXdui-NNEPbTVrxmdQddXLilhGaZBPCaTgjZ4ljUMzQpi5Ct4GUâ;const ethereumPrivateKeyProvider = new EthereumPrivateKeyProvider({
config: {
chainConfig: {
chainNamespace: CHAIN_NAMESPACES.EIP155,
chainId: â0x1â,
rpcTarget: âhttps://rpc.ankr.com/ethâ,
displayName: âEthereum Mainnetâ,
blockExplorerUrl: âhttps://etherscan.ioâ,
ticker: âETHâ,
tickerName: âEthereumâ,
},
},
});
const web3auth = new Web3Auth(WebBrowser, SecureStore, {
clientId,
redirectUrl,
network: OPENLOGIN_NETWORK.SAPPHIRE_DEVNET,
});
