Skip to content

Twitch

In this guide, you will learn how to enable Twitch authentication and onboard dApp users.

Prerequisites

Note that some steps are performed using Twitch Developer Dashboard, others using Arcana Dashboard. After that simply integrate your dApp with the Arcana Auth SDK to trigger Twitch login and onboard users.

To enable Twitch based social authentication in Web3 applications, developers must perform these three steps before integrating with the Arcana Auth SDK.

Step 1: Use Arcana Dashboard

Go to the Arcana Dashboard: https://dashboard.arcana.network

Register your dApp by creating a new dApp entry and specifying a name using the 'Create New App' wizard.

Registering the Application

If you have already registered your dApp using Arcana Dashboard and obtained an App Address, you may skip this step.

Use defaults for other settings or change them as per your use case. Refer to the how to configure dApp guide for details.

Go to the Configure->Social Auth configuration section and copy the redirect URI value displayed there. This will be used in the next step to generate Twitch OAuth credentials.

redirect_page

Do not close the dashboard browser tab. Open another tab and set up Twitch OAuth. Then come back to the Dashboard tab and complete the dApp configuration settings.

Step 2: Use Twitch Developer Console

Go to the Twitch Developer Console and register your dApp as a new Twitch application. twitch console

Enter the application name.

Specify the Redirect URI copied from Arcana Dashboard in the previous step into the OAuth Redirect URL field of the Twitch Developer Console.

Copy the ClientID that is automatically generated by Twitch for the newly registered application in the Twitch Developer Console. It will be required in the next step while completing the Arcana dashboard dApp configuration.

twitch config details

Step 3: Update Arcana Dashboard

Revisit the Arcana Developer Dashboard portal. Click on your app entry and visit the application dashboard. Click Configure->Social Auth in the LHS navigation bar. Refer to the "Twitch" field and paste the Client ID assigned by Twitch Developer Console, in the previous step, in the input text field.

howto_config_twitch

Save the settings. Arcana Network assigns an App Address to every registered and configured dApp. You need to save this App Address and use it while integrating the dApp with the Auth SDK.

App Address

You are all set with Twitch Setup. Integrate Web3 application with the Arcana Auth SDK and call social login function when the user chooses to log in.

Tip

The App Address is displayed on the top right of your dashboard.

You can revisit the Arcana Dashboard later to view and modify configuration settings.

Step 4: Integrate with Arcana Auth SDK and trigger Twitch login

Use instructions here to integrate with Arcana Auth SDK

After integration, use the following code to trigger Twitch login to onboard users:

await auth.loginWithSocial('twitch')

Check if a user is logged in:

const connected = await auth.isLoggedIn()

Use other Auth SDK functions in your dApp. See Auth SDK Usage Guide for details.

Add code in the application to log out an authenticated user:

await auth.logout()

That is all!

Your dApp is all set for onboarding users via Twitch.

What's Next?

After enabling user sign-in via Twitch, you can allow authenticated users to access the Arcana wallet for signing blockchain transactions on any EVM-compatible network.

See also


Last update: January 11, 2023 by shaloo