Server Authentication with Bot Token Endpoint
Use the Bot Token Endpoint if your game has an account system which uniquely identifies users. You pass your account system’s unique ID for the user, and Discord returns an access token — creating a provisional account for that identity if one does not already exist. No identity provider configuration is required for this method. If you have a hard requirement for a turnkey OIDC integration, see External Credentials Exchange; if you don’t have a backend, see Public Client Integration.Server: Create the Provisional Token
Your backend exchanges the player’s identity for a Discord access token. Keep this call and your bot token on the server, exposed to the client through your own authenticated endpoint:Bot Token Endpoint Response
Client: Connect With the Token
The game client receives theaccess_token from your backend — it never sees the bot token — and passes it straight to the SDK. Set your application ID, call Client::UpdateToken with the token as a Bearer token, then Client::Connect:
How the Integration Fits Together
Because your bot token never reaches the client, the client can’t call Discord’s bot token endpoint directly. Instead, your server brokers the request:- The player signs in with your own account system, as they normally would.
- The game client asks your backend for a Discord provisional token.
- Your backend calls Discord’s
/partner-sdk/token/botendpoint — authenticated with your bot token — passing the player’sexternal_user_id(and optionalpreferred_global_name), and returns the resultingaccess_tokento the client. - The client hands that token to the SDK with
Client::UpdateTokenand callsClient::Connect.
Error Handling
Common error codes and solutions when creating a provisional account:Next Steps
Managing Provisional Accounts
Refresh access tokens and set display names.
Merging Accounts
Merge a provisional account into a full Discord account.
Unmerging Accounts
Sever the link between a Discord account and a provisional account.
#social-sdk-dev-help channel for support from the community.
If you encounter a bug while working with the Social SDK, please report it here: https://dis.gd/social-sdk-bug-report