Twitch Social Login with Web3Auth
Create a Twitch app
-
Follow Twitch's registration instructions to (register your app)[https://dev.twitch.tv/console/apps/create].
-
Paste the following as a Redirect URI into the "OAuth Redirect URLs" field.
-
After creation of your Twitch app, click Manage
-
Obtain the Client ID
Create a Twitch verifier
-
Go to the Web3Auth dashboard and select your project. Click on the
Custom Authentication
tab, then click on theCreate Verifier
button to create a new verifier.
- Create a verifier for your Twitch application by selecting
Twitch
as the Login provider from this modal. - Paste the Client ID from the Twitch App(above) to the
Client ID
field and click on Create.
Example
- Modal SDK
- No Modal SDK
import { AuthAdapter } from "@web3auth/auth-adapter";
import { CHAIN_NAMESPACES } from "@web3auth/base";
// Create AuthAdapter instance once you have created Web3Auth instance
const authAdapter = new AuthAdapter({
adapterSettings: {
loginConfig: {
twitch: {
verifier: "w3a-twitch-demo", // Pass the Verifier name here
typeOfLogin: "twitch", // Pass on the login provider of the verifier you've created
clientId: "3k7e70gowvxjaxg71hjnc8h8ih3bpf", // Pass on the Twitch `Client ID` here
},
},
},
});
web3AuthInstance.configureAdapter(authAdapter);
// Initialize Modal
await web3AuthInstance.initModal();
// Login with Twitch
await web3AuthInstance.connect();
import { AuthAdapter } from "@web3auth/auth-adapter";
// Create AuthAdapter instance once you have created Web3AuthNoModal instance
const authAdapter = new AuthAdapter({
adapterSettings: {
loginConfig: {
twitch: {
verifier: "w3a-twitch-demo", // Pass the Verifier name here
typeOfLogin: "twitch", // Pass on the login provider of the verifier you've created
clientId: "3k7e70gowvxjaxg71hjnc8h8ih3bpf", // Pass on the Twitch `Client ID` here
},
},
},
});
web3AuthNoModalInstance.configureAdapter(authAdapter);
// Initialize
await web3AuthNoModalInstance.init();
// Login with Twitch
await web3AuthNoModalInstance.connectTo(WALLET_ADAPTERS.AUTH, {
loginProvider: "twitch",
});