Prerequisites

  • Discord account
  • Access to Discord Developer Portal

Step 1: Create Discord Developer Account

  1. Visit https://discord.com/developers
  2. Click “Get Started” or “Login” if you already have an account
  3. Sign in with your Discord account or create a new developer account
Discord Developer Login

Step 2: Create a New App

  1. Once logged in, go to “Applications” in your developer dashboard
  2. Click “New Application” to create a new app
Create New Application
  1. Click on the “App” that you just created
  2. Go to “General Information” section
  3. Fill in the app details:
    • App name: Your application name (e.g., your brand name)
    • App description: Your application description
    • “App Icon”: Upload 100x100px PNG (recommended)
    • “Tags”: Add tags that describe your application
    • Privacy policy URL: Your privacy policy URL
    • Terms of service URL: Your terms of service URL
General App Information

Step 3: Build A Bot

  1. Go to “Bot” section.
  2. Get Discord Token:
  • Click on Reset Token button under TOKEN tab
  • Enter your Discord Password and press Submit
  • New Token has been generated
  • Copy this token (keep it secure!)
Generate Discord Token
  1. Set Bot Permissions:
  • Choose Administrator under General Permissions (recommended)
Setting Bot Permissions
Klavis AI recommends to select required OAuth scopes only.

Step 4: Configure OAuth Settings

Navigate to “OAuth2”: Configure OAuth Settings
Normally, the redirect URI should be set to: https://api.klavis.ai/oauth/discord/callback

Step 5: OAuth2 URL Generator

  1. Scroll to Scopes
  • Select bot from the scopes list
  • For Bot Permissions: select Administrator
OAuth2 URL Generator
  1. Generate URL:
  • Integration Type: Guild Install (recommended)
  • Copy Generated URL and paste in browser to complete authentication
Generate OAuth2 URL and paste in browser
You have successfully created a Discord OAuth application! You now have your Client ID and Client Secret, and Discord Token ready for integration with Klavis AI.

(Optional) Step 6: White Labeling

White labeling allows you to customize the OAuth experience with your own branding instead of Klavis AI’s.
If you want to use your own Discord OAuth application with custom branding:
  1. Configure White Labeling: Go to https://www.klavis.ai/home/white-label
  2. Add Your Credentials: Enter your Discord Client ID and Client Secret from Step 4
  3. Set Redirect URI: Use https://api.klavis.ai/oauth/discord/callback or your custom callback URL
  4. Initiate OAuth: Use your client ID when starting the OAuth flow:
    // Example: Initiating Discord OAuth with white-label
    const authUrl = `https://api.klavis.ai/oauth/discord/authorize?instance_id=${instanceId}&client_id=${yourClientId}`;
    window.location.href = authUrl;
    
For detailed white labeling implementation and code examples, see our OAuth & White Labeling guide.

Resources