Skip to content

Social SDK: Add Rich Presence without authentication documentation #7744

New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Merged
Merged
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
Original file line number Diff line number Diff line change
@@ -1,7 +1,6 @@
---
sidebar_label: Setting Rich Presence
---
import PublicClient from '../partials/callouts/public-client.mdx';
import SupportCallout from '../partials/callouts/support.mdx';

[Home](/docs/intro) > [Discord Social SDK](/docs/discord-social-sdk/overview) > [Development Guides](/docs/discord-social-sdk/development-guides) > {sidebar_label}
Expand Down Expand Up @@ -198,6 +197,55 @@ activity.SetSupportedPlatforms(discordpp::ActivityGamePlatforms::Desktop);

See the `ActivityGamePlatforms` enum for all supported platforms.

## Rich Presence Without Authentication

:::warn
Rich Presence via RPC (Remote Procedure Call) will only work with a running Discord desktop client. It does not support mobile, console or web clients.
:::

Unlike most other features of the Discord Social SDK, **Rich Presence can be set without authentication**. Instead of
using [`Client::Connect`] to authenticate with Discord, you can use Rich Presence functionality by directly communicating
with a running Discord desktop client through RPC (Remote Procedure Call).

### Setting Up Direct Rich Presence

To use Rich Presence without authentication, simply:

1. Set your application ID using [`Client::SetApplicationId`]
2. Configure your activity details
3. Call [`Client::UpdateRichPresence`]

```cpp
auto client = std::make_shared<discordpp::Client>();

// Set the application ID (no Connect() call needed)
client->SetApplicationId(APPLICATION_ID);

// Configure rich presence details
discordpp::Activity activity;
activity.SetType(discordpp::ActivityTypes::Playing);
activity.SetState("In Competitive Match");
activity.SetDetails("Rank: Diamond II");

// Update rich presence
client->UpdateRichPresence(
activity, [](const discordpp::ClientResult &result) {
if (result.Successful()) {
std::cout << "🎮 Rich Presence updated successfully!\n";
} else {
std::cerr << "❌ Rich Presence update failed";
}
});
```

### Requirements
Copy link
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

wdyt about moving requirements above "Setting Up Direct Rich Presence"?

Copy link
Contributor Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

oh that was a good call. I'll make a separate PR.


* Discord desktop client must be running on the user's machine
* Your application must be registered with Discord and have a valid Application ID

This direct approach makes Rich Presence integration much simpler for developers who only need basic presence
functionality while Discord desktop clients are running.

---

## Next Steps
Expand Down Expand Up @@ -228,4 +276,7 @@ Now that you've set up Rich Presence, you might want to explore:

{/* Autogenerated Reference Links */}
[`Activity`]: https://discord.com/developers/docs/social-sdk/classdiscordpp_1_1Activity.html#ae793d9adbe16fef402b859ba02bee682
[`ActivityTypes`]: https://discord.com/developers/docs/social-sdk/namespacediscordpp.html#a6c76a8cbbc9270f025fd6854d5558660
[`ActivityTypes`]: https://discord.com/developers/docs/social-sdk/namespacediscordpp.html#a6c76a8cbbc9270f025fd6854d5558660
[`Client::Connect`]: https://discord.com/developers/docs/social-sdk/classdiscordpp_1_1Client.html#a873a844c7c4c72e9e693419bb3e290aa
[`Client::SetApplicationId`]: https://discord.com/developers/docs/social-sdk/classdiscordpp_1_1Client.html#ad452335c06b28be0406dab824acccc49
[`Client::UpdateRichPresence`]: https://discord.com/developers/docs/social-sdk/classdiscordpp_1_1Client.html#af0a85e30f2b3d8a0b502fd23744ee58e