Skip to main content

Discord Social Login with Web3Auth

Discord Login is a social login provider that allows users to sign in using their Discord credentials. Web3Auth supports Discord as a social login provider, allowing developers to offer a familiar and quick authentication method for users with Discord accounts.

To integrate Discord with Web3Auth, developers must first create a Discord App via the Discord Developer Portal.

Create a Discord app

  1. Create a Discord API application.

  2. Navigate to OAuth2 from the sidebar, and paste the following as Redirect URI into the "Redirect URI" field.

    Discord OAuth2.0 App Dashboard

  3. Don't forget to save your changes!

  4. Next, obtain the "Client ID" from here. We will use this in our Web3Auth Dashboard.

    Discord OAuth2.0 App Client ID and Secret

Create a Discord Connection

Enable on Dashboard

To use this feature, please enable Discord from the Social Connections section in the Web3Auth Dashboard.

By default, Web3Auth uses its own pre-configured credentials for Discord login.

Toggle Discord Connection on Dashboard

Follow these steps to create a Discord connection:

  1. Visit the Web3Auth Dashboard.
  2. Go to the Social Connections section.
  3. Click on the Settings icon near the Discord connection.
  4. Enter the Auth Connection ID.
  5. Enter the Discord Client ID.
  6. Finally, click on the Add Connection button.
Discord Connection

Usage

Since, the Discord Connection details are available from Dashboard, developers don't need to pass any additional parameters to the Web3AuthProvider.

Follow our Quickstart Guide to setup the basic flow.

Login with Discord

await connectTo(WALLET_CONNECTORS.AUTH, {
authConnection: AUTH_CONNECTION.DISCORD,
authConnectionId: "w3a-discord-demo",
});