We are trying to integrate this into a .Net MVC website where the Vanilla JS would be our only option. Unless you have any advice on a different option to use?
Thanks.
Thanks for reaching out, Chris! I understand you’re trying to integrate Web3Auth into a .NET MVC website and noticed that the Vanilla JS Quick Start example link is no longer available on the docs.
Summary for Support Team:
SDK: Web3Auth Plug and Play (PnP) Web SDK
Platform: .NET MVC (frontend integration via Vanilla JS)
While the direct Vanilla JS Quick Start example seems to have been removed or relocated, you can still integrate Web3Auth into your .NET MVC frontend using the Web3Auth Modal SDK with plain JavaScript.
Here’s a minimal example to get you started:
Install the SDK via npm/yarn, or use a CDN in your HTML:
const { Web3Auth, WEB3AUTH_NETWORK } = window.web3auth;
const web3auth = new Web3Auth({
clientId: "YOUR_CLIENT_ID", // Replace with your actual Client ID
web3AuthNetwork: WEB3AUTH_NETWORK.SAPPHIRE_MAINNET,
});
async function init() {
await web3auth.init();
}
init();
// To trigger login
async function login() {
const provider = await web3auth.connect();
// Use the provider as needed
}
If you need a more complete example or run into any issues, please let us know! If you’re open to using a bundler, you could also use the npm package as described in the docs.
Questions for You (if needed):
Are you planning to use any specific social login providers?
Do you have any restrictions on using npm packages or only CDN/script tags?
Let us know if you need further details or a sample repository. We’re here to help you get started!
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
The referenced cdn link does not exist and the JS code looks like it is a mix of TS and JS code.
In any case, the bot solution is not that helpful.
If the Vanilla JS option is not being supportd any longer, then we may switch to React, but a pure JS option would definitely save us a lot of time.
We had a vanillaJS option and we did remove it because it was facing some errors with the latest version.
I will have to personally sit and create a new example from scratch for vanillaJS with Web3Auth v10 so that I can tell you for sure whether it’s an issue or you may be able to use it.
Let me know if you’re tied to some deadlines I have kept this task for the next to next week. Thanks.