Go through the "Getting Started" flow under the "Social SDK" section.
Add a redirect URL for your application in the developer portal on the OAuth2 tab. For desktop applications this should be http://127.0.0.1/callback, but you can change this later. See discordpp::Client::Authorize for more details on this redirect.
Enable the "Public Client" toggle in the developer portal on the OAuth2 tab. This will allow you to test the SDK without having a backend setup yet, but you should re-evaluate if you need this setting before shipping. See discordpp::Client::Authorize for more details on this.
Once you've registered callbacks with the SDK, you'll need to periodically execute them in the main loop of your program. Add something like this to your game's main event loop or tick function. If you're using the Unity or Unreal plugins, this is already handled for you.
Next you'll want to get an authentication token to use with the SDK. The discordpp::Client::Authorize and discordpp::Client::GetToken functions are the way to do this. Here's a code snippet that shows how you can initiate the OAuth2 flow and get an access token. You will likely also want to save the token to some secure and durable storage so you don't need to re-do the authorization flow each time.
auto codeVerifier = client->CreateAuthorizationCodeVerifier();
Now that you have an auth token you can connect the SDK. The example above shows how to pass in the auth token to the SDK and connect, but if you already have a token (such as one read from local storage), you can use the following:
NOTE: You won’t be able to browse files using that link, but that’s ok. Individual files are accessible under the domain and the URL will function properly as a symbol server, so it will work in Visual Studio.