Discord's Social SDK provides a way for games to deeply integrate with Discord. The SDK is a C++ library that Discord distributes and would be integrated and shipped with the game itself. We auto-generate a plugin for both Unity and Unreal and have a small sample app for each that demonstrates basic usage.
The SDK only provides access to data, it does not provide any UI. The expectation is that games will want to skin and customize any UI to match their game’s aesthetic, and so the SDK just provides access to the raw data and allows games to build the UI as they see fit.
Important Pages
Get started by checking out the Discord Social SDK Overview for our core concepts, getting started guides, development guides, design guidelines and more.
Explore SDK functionality by checking out: discordpp::Client, which is the entrypoint for the SDK
Functionality
A user in an integrated game can:
Link their Discord account
View (and modify) their Discord friend list
Publish rich presence data so their friends know what they are up to
Send and accept invites to play with others
And if authorized to use the communications feature, games can also:
Send and view DMs with friends
Communicate in text or voice with the people they are playing with
Link a Discord channel from their friend server to the game so they can see and respond to messages without context switching
We also recognize that it would be frustrating if this functionality only worked for users that chose to link their Discord account to the game. You'd have to have one friend system for Discord users and one for everyone else. And even more importantly, it could mean that users have a different game experience based on whether their friends had linked an account or not! So also as part of this SDK we have introduced a "provisional account" system, which are limited Discord accounts owned and managed by the game. You can create these under the hood for players who choose not to link their Discord account, which allows you to use the same API regardless of whether a user has linked their account.
Concepts
The SDK introduces a number of new concepts that even folks familiar with Discord may not be aware of so here’s a quick reference:
Linking an account: A simple oauth flow that allows a developer to get an access token so they can authenticate as a user and gain access to the previously mentioned data and actions. See discordpp::Client::Authorize.
Provisional account: A limited Discord account that can be created and managed by a game for users that choose not to link their Discord account. A game can use this for storing a user's friends, accessing chat, and more. Users will likely never know this exists because it's an under the hood concept to simplify your integrations. See discordpp::Client::GetProvisionalToken.
Relationship: A relationship is how Discord models friendships, but it includes all types of relationships one user might have with another. This includes sending them an invite to be a friend and blocking a user from interacting with you. Each of these are types of relationships. See discordpp::RelationshipHandle.
Rich Presence: Rich presence on the other hand is information published by a game back to Discord, indicating which game a user is currently playing, as well as information about whether or how to join that game. Specifically Discord uses the concept of an Activity, which encompasses all the information about the game a user is playing, and that activity is published as part of the rich presence information. See discordpp::Activity.
Lobby: A virtual "room" that the game can control. Games can add a number of users to a lobby, all of whom can communicate over text and voice with each other. See discordpp::LobbyHandle.
Call: Discord's internal name for an active voice chat happening within a Lobby. See discordpp::Call.
Linked Channel: A way of letting users pick a channel in one of their Discord servers to show up in game, so they can see and respond to chat messages without having to leave the game. See discordpp::LobbyHandle.