Skip to content
Talk to an Engineer Dashboard

Discord

Connect to Discord. Read user profiles, list guilds, retrieve member data, check entitlements, and verify OAuth2 authorization details.

Connect to Discord. Read user profiles, list guilds, retrieve member data, check entitlements, and verify OAuth2 authorization details.

Discord logo

Supports authentication: OAuth 2.0

Register your Scalekit environment with the Discord connector so Scalekit handles the OAuth 2.0 (PKCE) flow and token lifecycle for you. The connection name you create will be used to identify and invoke the connection programmatically.

  1. Create a Discord application

    • Go to the Discord Developer Portal and sign in with your Discord account.

    • Click New Application, enter a name for your app (e.g., My Agent), accept the terms, and click Create.

  2. Set up the OAuth2 redirect URI

    • In Scalekit dashboard, go to Agent AuthCreate Connection. Find Discord and click Create. Copy the redirect URI shown — it looks like:

      https://<SCALEKIT_ENVIRONMENT_URL>/sso/v1/oauth/<CONNECTION_ID>/callback

    • Back in the Discord Developer Portal, open your application and go to OAuth2 in the left sidebar.

    • Under Redirects, click Add Redirect, paste the URI from Scalekit, and click Save Changes.

  3. Copy your credentials

    • On the OAuth2 page, copy the Client ID.

    • Click Reset Secret to generate a Client Secret and copy it immediately. It will not be shown again.

  4. Add credentials in Scalekit

    • In Scalekit dashboard, go to Agent AuthConnections and open the connection you created.

    • Enter the credentials you copied:

      • Client ID

      • Client Secret

      • Scopes — select the scopes your agent needs. Common scopes:

        ScopeWhat it grants
        identifyRead basic user profile (username, avatar, discriminator)
        emailRead the user’s email address
        guildsList the guilds the user belongs to
        guilds.members.readRead the user’s member data within a guild
        connectionsRead third-party accounts linked to the user’s Discord profile
        openidUse Discord as an OpenID Connect provider
        applications.entitlementsRead premium entitlements for your application

    • Click Save.

Connect a user’s Discord account and make API calls on their behalf — Scalekit handles OAuth 2.0 (PKCE), token storage, and refresh automatically.

You can interact with Discord in two ways — via direct proxy API calls or via Scalekit optimized tool calls. Scroll down to see the list of available Scalekit tools.

Proxy API Calls

import { ScalekitClient } from '@scalekit-sdk/node';
import 'dotenv/config';
const connectionName = 'discord'; // get your connection name from connection configurations
const identifier = 'user_123'; // your unique user identifier
// Get your credentials from app.scalekit.com → Developers → Settings → API Credentials
const scalekit = new ScalekitClient(
process.env.SCALEKIT_ENV_URL,
process.env.SCALEKIT_CLIENT_ID,
process.env.SCALEKIT_CLIENT_SECRET
);
const actions = scalekit.actions;
// Authenticate the user — send this link to your user
const { link } = await actions.getAuthorizationLink({
connectionName,
identifier,
});
console.log('🔗 Authorize Discord:', link);
process.stdout.write('Press Enter after authorizing...');
await new Promise(r => process.stdin.once('data', r));
// Fetch the authenticated user's Discord profile via Scalekit proxy
const user = await actions.request({
connectionName,
identifier,
path: '/api/users/@me',
method: 'GET',
});
console.log(user);

Scalekit Tools

Retrieves a PNG image widget for a Discord guild. Returns a visual representation of the guild widget that can be embedded on external websites. The widget must be enabled in the guild’s server settings under Server Settings → Widget.

NameTypeRequiredDescription
guild_idstringYesThe ID of the guild whose widget PNG to retrieve

Retrieves entitlements for the current user for a given application. Use when you need to check what premium offerings or subscriptions the authenticated user has access to. Requires the applications.entitlements OAuth2 scope.

NameTypeRequiredDescription
application_idstringYesThe ID of the Discord application to check entitlements for
sku_idstringNoFilter entitlements by a specific SKU ID
beforestringNoRetrieve entitlements before this entitlement ID (for pagination)
afterstringNoRetrieve entitlements after this entitlement ID (for pagination)
limitintegerNoMaximum number of entitlements to return (1–100, default 100)
guild_idstringNoFilter entitlements for a specific guild
exclude_endedbooleanNoSet to true to exclude entitlements that have already ended

Retrieves the guild widget in JSON format. Returns public information about a Discord guild’s widget including online member count and invite URL. The widget must be enabled in the guild’s server settings.

NameTypeRequiredDescription
guild_idstringYesThe ID of the guild whose widget JSON to retrieve

Retrieve information about a Discord user. With an OAuth Bearer token, pass @me as user_id to return the authenticated user’s information. With a Bot token, you can query any user by their ID. Returns username, avatar, discriminator, locale, premium status, and email (if the email scope is granted).

NameTypeRequiredDescription
user_idstringYesThe ID of the user to retrieve, or @me to get the authenticated user

Fetches comprehensive profile information for the currently authenticated Discord user, including username, avatar, discriminator, locale, and email if the email OAuth2 scope is granted. No additional parameters required — uses the OAuth token of the connected account.

This tool takes no input parameters.

Retrieves information about a specific invite code including guild and channel details.

NameTypeRequiredDescription
invite_codestringYesThe Discord invite code to look up (the part after discord.gg/)
with_countsbooleanNoSet to true to include approximate member and presence counts
with_expirationbooleanNoSet to true to include expiration date information

Retrieves information about a Discord guild template using its unique template code. Use when you need to get details about a guild template for creating new servers or auditing template configurations.

NameTypeRequiredDescription
template_codestringYesThe unique code of the guild template to retrieve

Retrieves Discord OAuth2 public keys (JWKS). Use when you need to verify OAuth2 tokens or perform cryptographic signature verification against Discord-issued tokens.

This tool takes no input parameters.

Lists the current user’s guilds, returning partial data (id, name, icon, owner, permissions, features) for each. Primarily used for displaying server lists or verifying guild memberships. Requires the guilds OAuth2 scope.

NameTypeRequiredDescription
beforestringNoRetrieve guilds with IDs before this guild ID (for pagination)
afterstringNoRetrieve guilds with IDs after this guild ID (for pagination)
limitintegerNoMaximum number of guilds to return (1–200, default 200)
with_countsbooleanNoSet to true to include approximate member and presence counts

Retrieves OpenID Connect compliant user information for the authenticated user. Returns standardized OIDC claims (sub, email, nickname, picture, locale, etc.) following the OpenID Connect specification. Requires an OAuth2 access token with the openid scope; additional fields require the identify and email scopes.

This tool takes no input parameters.

Retrieves a valid WebSocket (wss://) URL for establishing a Gateway connection to Discord. Use when you need to connect to the Discord Gateway for real-time events. No authentication required.

This tool takes no input parameters.

Retrieves the guild member object for the currently authenticated user within a specified guild, including roles, nickname, join date, and avatar. Requires the guilds.members.read OAuth2 scope.

NameTypeRequiredDescription
guild_idstringYesThe ID of the guild to retrieve the authenticated user’s member data from

Retrieves all available Discord Nitro sticker packs. Returns official Discord sticker packs including pack name, description, stickers, cover sticker, and banner asset. No authentication required.

This tool takes no input parameters.

Resolves and retrieves information about a Discord invite code, including the associated guild, channel, scheduled event, and inviter. Prefer this over the deprecated get_invite tool for new integrations.

NameTypeRequiredDescription
invite_codestringYesThe Discord invite code to resolve (the part after discord.gg/)
with_countsbooleanNoSet to true to include approximate member and presence counts
with_expirationbooleanNoSet to true to include expiration date information
guild_scheduled_event_idstringNoInclude details about a specific scheduled event associated with this invite

Retrieves current OAuth2 authorization details for the application, including app info, granted scopes, token expiration date, and user data (contingent on scopes like identify). Useful for verifying what access the current token has before making downstream API calls.

This tool takes no input parameters.

Retrieves a list of the authenticated user’s connected third-party accounts on Discord, such as Twitch, YouTube, GitHub, Steam, and others. Returns the service name, account ID, account name, and visibility for each connection. Requires the connections OAuth2 scope.

This tool takes no input parameters.