Skip to main content
The Social SDK reference documentation provides a complete API reference for all classes, methods, enumerations, and types available in the Discord Social SDK.
The full API reference is hosted externally as auto-generated documentation from the SDK source code. Click the link below to open it.

Discord Social SDK API Reference

Browse the complete API reference documentation including all classes, methods, enumerations, and types.

Key classes

The following are the most commonly used classes in the Discord Social SDK.

Client

The Client class is the main entry point for the Discord Social SDK. It manages authentication, connection state, and provides access to all social features.
MethodDescription
Client::AuthorizeInitiate OAuth2 authorization flow
Client::ConnectEstablish connection to Discord
Client::UpdateTokenSet the access token for API calls
Client::GetTokenExchange authorization code for access token (public clients)
Client::RefreshTokenRefresh an expired access token
Client::RevokeTokenRevoke access and refresh tokens
Client::GetDefaultPresenceScopesReturns openid sdk.social_layer_presence
Client::GetDefaultCommunicationScopesReturns openid sdk.social_layer
Client::CreateAuthorizationCodeVerifierGenerate PKCE code verifier and challenge
Client::GetRelationshipsGet all relationships for the current user
Client::GetRelationshipsByGroupGet relationships organized by status group
Client::SetRelationshipGroupsUpdatedCallbackCallback when friends list grouping changes
Client::UpdateRichPresenceUpdate the user’s rich presence activity
Client::SetApplicationIdSet the application ID (for RPC-only rich presence)
Client::CreateOrJoinLobbyCreate or join a lobby by secret
Client::LeaveLobbyLeave a lobby
Client::SendLobbyMessageSend a message to a lobby
Client::GetLobbyMessagesWithLimitRetrieve lobby chat history
Client::StartCallStart or join a voice call in a lobby
Client::StartCallWithAudioCallbacksStart a call with custom audio processing
Client::EndCallEnd a voice call in a specific lobby
Client::EndCallsEnd all active voice calls
Client::SetSelfMuteAllMute microphone across all calls
Client::SetSelfDeafAllDeafen across all calls
Client::SetInputVolumeSet microphone volume
Client::SetOutputVolumeSet speaker volume
Client::AddLogCallbackRegister a logging callback
Client::SetLogDirWrite SDK logs to a directory
Client::SetAecDumpEnable AEC diagnostic recording
Client::SetStatusChangedCallbackMonitor client connection status
Client::SetUserUpdatedCallbackCallback when a user’s info changes
Client::SetRelationshipCreatedCallbackCallback when a relationship is created
Client::SetRelationshipDeletedCallbackCallback when a relationship is deleted
Client::SetMessageCreatedCallbackCallback when a message is received
Client::GetProvisionalTokenCreate a provisional account token

Activity

The Activity class represents a user’s rich presence. Set it using Client::UpdateRichPresence.
MethodDescription
Activity::SetTypeSet the activity type (e.g., ActivityTypes::Playing)
Activity::SetDetailsSet the main description line
Activity::SetStateSet the secondary status line
Activity::SetTimestampsSet start/end timestamps
Activity::SetAssetsSet large/small images and invite cover image
Activity::SetPartySet party ID, current size, and max size
Activity::SetSecretsSet join secret for game invites
Activity::SetSupportedPlatformsSet where join buttons appear
Activity::SetStatusDisplayTypeControl what appears in status text
Activity::SetStateUrlMake the state field a clickable link
Activity::SetDetailsUrlMake the details field a clickable link

Call

The Call class represents an active voice call in a lobby.
MethodDescription
Call::SetSelfMuteMute your microphone in this call
Call::SetSelfDeafDeafen yourself in this call
Call::SetParticipantVolumeAdjust a specific participant’s volume
Call::SetVADThresholdConfigure voice activity detection sensitivity

UserHandle

The UserHandle class represents a Discord user. Handle objects automatically reflect data changes without needing to be recreated.
PropertyDescription
UserHandle::IdUser’s Discord ID
UserHandle::DisplayNameUser’s display name
UserHandle::StatusUser’s online status (StatusType)
UserHandle::GameActivityUser’s current game activity (if in your game)
UserHandle::IsProvisionalWhether the user has a provisional account

VoiceStateHandle

The VoiceStateHandle class provides voice state information for a voice call participant.
MethodDescription
VoiceStateHandle::SelfMuteReturns true if the user has muted themselves
VoiceStateHandle::SelfDeafReturns true if the user has deafened themselves

Key enumerations

ActivityTypes

ValueDescription
PlayingStandard game activity — use this for games
StreamingStreaming activity
ListeningListening activity
WatchingWatching activity

RelationshipType

ValueDescription
FriendConfirmed friendship
PendingOutgoingSent friend request waiting for acceptance
PendingIncomingReceived friend request waiting for response
BlockedBlocked user

RelationshipGroupType

Used with Client::GetRelationshipsByGroup to retrieve pre-sorted friend groups:
ValueDescription
OnlinePlayingGameFriends online and playing your game
OnlineElsewhereFriends online but not in your game
OfflineFriends who are offline

StatusType

ValueDescription
OnlineUser is online
IdleUser is idle
DoNotDisturbUser has Do Not Disturb enabled
OfflineUser is offline

AuthorizationTokenType

ValueDescription
BearerStandard OAuth2 bearer token

LoggingSeverity

ValueDescription
Verbose (1)All log messages
Info (2)Informational messages
Warn (3)Warnings only
Error (4)Errors only (recommended for production)

AuthorizationArgs

AuthorizationArgs is passed to Client::Authorize to configure the OAuth2 authorization request.
MethodDescription
AuthorizationArgs::SetClientIdSet your Discord Application ID
AuthorizationArgs::SetScopesSet the OAuth2 scopes to request
AuthorizationArgs::SetCodeChallengeSet the PKCE code challenge

Free functions

FunctionDescription
discordpp::RunCallbacksProcess pending SDK callbacks — call from your game loop
discordpp::EnumToStringConvert an SDK enum value to its string representation

Next steps

Getting started

Set up the SDK in your game engine.

Development guides

Step-by-step guides for each social feature.

How-to guides

Common solutions for debugging and production setup.

Build docs developers (and LLMs) love