Web3Auth RN example not working

I use this React Native example

After i login with my gmail, in console, it says: JSON Parse error: unexpected character: u

Hi Vic! Thanks for sharing the details and the link to the example repo you’re using.

Here’s a summary of your issue for the support team:


Issue Summary

  • SDK & Platform: PnP React Native SDK (Bare workflow)
  • Example Used: web3auth-react-native-examples/rn-bare-quick-start
  • Login Method: Gmail (social login)
  • Problem: After logging in with Gmail, the console outputs:
    JSON Parse error: unexpected character: u

Next Steps / Info Needed

To help the team diagnose this, could you please provide:

  1. SDK Version:
    Which version of @web3auth/react-native-sdk (and related packages) are you using? This can be found in your package.json.

  2. Login & Initialization Code:
    Please share the code snippet where you initialize Web3Auth and handle the login. This helps us spot any configuration issues.

  3. Console Output:
    If possible, a screenshot or copy of the full error message and stack trace from your terminal or device logs.


Possible Cause & Suggestions

  • The error JSON Parse error: unexpected character: u often happens if a function expects a JSON string but receives something else (like undefined or a plain object).
  • Double-check that the response you get from the login function is being parsed as JSON only if it’s actually a JSON string.
  • Make sure you’re using the correct redirect URL and configuration for React Native, as described in the Web3Auth React Native Quick Start.

Once you provide the above details, the support team can dig deeper and help you resolve this quickly! Thank you for your patience and for trying out Web3Auth.

Note: This response was generated by an AI bot and may require further verification. The Web3Auth support team has tracked this issue and will be responding as soon as possible.

Additionally, we would recommend you to join our biweekly Office Hours to get this resolved even faster. Web3Auth Developer Office Hours


here is the screenshot

@web3auth/react-native-sdk”: “^8.0.0”,

above is the sdk version

Are you facing this issue with other react native examples as well?

i have only tried web3auth-react-native-examples/rn-bare-quick-start

const scheme = “web3authrnexample”; // Or your desired app redirection scheme

// IMP START - Whitelist bundle ID

const redirectUrl = ${scheme}://auth;

// IMP END - Whitelist bundle ID

this name of scheme, , this scheme is to be whitelisted in dev dashboard?

Can you switch the rpcUrl to a paid provider like Infura and try again?
This seems like an issue that has crept in due to failing public RPCs. Or you can try using any other WORKING pubic RPC like https://ethereum-sepolia-rpc.publicnode.com which I do not recommend, sincethis might go down as well, as it’s a public RPC.


It seems the rpcTarget: "https://ethereum-sepolia-rpc.publicnode.com ", fails too.

change to paid RPC, now the error is below. It seems Web3Auth RN sdk is broken.

sometimes when running the RN sample app, i have this error “Web3auth not initialized” in the console of the sample app.

Unfortunately, web3Auth RN SDK is poorly made, and full of bugs.

I would highly suggest you to please use paid RPC service for now as public RPCs are very unreliable. At least until the next release is out where we provide bundled premium Infura RPC access for a bunch of EVM chains. And the whole configuration is very simplified than the current setup.

Can you please try cloning the rn-bare-example here

This is in the branch test-rn-bare-example
I was able to run this example on my machine without any hiccups.
if these works for you as well, we’ll incorporate these changes to the main branch.

Good work. That works for me.

Now i am getting this error, global.base64FromArrayBuffer is not a function.

i fix it by adding base64FromArrayBuffer to globals.js