Skip to main content

Usage

Prerequisites

Discord Setup

After installing the OAuth extension, you can now enable Discord Login for your Magic app:
  1. Create a Discord API application
  2. Go to your Magic Dashboard
  3. Select the Magic app for which you’d like to enable Discord Login, or create a new app
  4. Navigate to Social Login from the sidebar
  5. Click the toggle for Discord
  6. Return to your Discord developer Dashboard, navigate to OAuth2 from the sidebar, and add your Redirect URI: Add the Redirect URI you are passing as the redirectURI argument to the loginWithRedirect method:
    JavaScript
    await magic.oauth2.loginWithRedirect({
      provider: 'discord',
      redirectURI: 'https://your-app.com/your/oauth/callback', // whitelist this with Discord
    });
    
Discord OAuth2 settings page with Redirect URI input field
  1. Save your changes in the Discord OAuth2 settings
  2. Next, obtain the Client ID and Client Secret from the current page
Discord application settings showing Client ID and Client Secret
  1. Return to your Magic Dashboard and input the Client ID and Client Secret for your Discord OAuth app
  2. In Magic Dashboard, click Save

Resources