Skip to content

Commit d6870a1

Browse files
authored
Social SDK: Add Rich Presence without authentication documentation (#7744)
Add comprehensive documentation for using Rich Presence via direct RPC communication without requiring full Discord authentication. This enables simpler integration for developers who only need basic presence functionality while Discord desktop clients are running.
1 parent ad03eac commit d6870a1

File tree

1 file changed

+53
-2
lines changed

1 file changed

+53
-2
lines changed

docs/discord-social-sdk/development-guides/setting-rich-presence.mdx

Lines changed: 53 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -1,7 +1,6 @@
11
---
22
sidebar_label: Setting Rich Presence
33
---
4-
import PublicClient from '../partials/callouts/public-client.mdx';
54
import SupportCallout from '../partials/callouts/support.mdx';
65

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

199198
See the `ActivityGamePlatforms` enum for all supported platforms.
200199

200+
## Rich Presence Without Authentication
201+
202+
:::warn
203+
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.
204+
:::
205+
206+
Unlike most other features of the Discord Social SDK, **Rich Presence can be set without authentication**. Instead of
207+
using [`Client::Connect`] to authenticate with Discord, you can use Rich Presence functionality by directly communicating
208+
with a running Discord desktop client through RPC (Remote Procedure Call).
209+
210+
### Setting Up Direct Rich Presence
211+
212+
To use Rich Presence without authentication, simply:
213+
214+
1. Set your application ID using [`Client::SetApplicationId`]
215+
2. Configure your activity details
216+
3. Call [`Client::UpdateRichPresence`]
217+
218+
```cpp
219+
auto client = std::make_shared<discordpp::Client>();
220+
221+
// Set the application ID (no Connect() call needed)
222+
client->SetApplicationId(APPLICATION_ID);
223+
224+
// Configure rich presence details
225+
discordpp::Activity activity;
226+
activity.SetType(discordpp::ActivityTypes::Playing);
227+
activity.SetState("In Competitive Match");
228+
activity.SetDetails("Rank: Diamond II");
229+
230+
// Update rich presence
231+
client->UpdateRichPresence(
232+
activity, [](const discordpp::ClientResult &result) {
233+
if (result.Successful()) {
234+
std::cout << "🎮 Rich Presence updated successfully!\n";
235+
} else {
236+
std::cerr << "❌ Rich Presence update failed";
237+
}
238+
});
239+
```
240+
241+
### Requirements
242+
243+
* Discord desktop client must be running on the user's machine
244+
* Your application must be registered with Discord and have a valid Application ID
245+
246+
This direct approach makes Rich Presence integration much simpler for developers who only need basic presence
247+
functionality while Discord desktop clients are running.
248+
201249
---
202250
203251
## Next Steps
@@ -228,4 +276,7 @@ Now that you've set up Rich Presence, you might want to explore:
228276
229277
{/* Autogenerated Reference Links */}
230278
[`Activity`]: https://discord.com/developers/docs/social-sdk/classdiscordpp_1_1Activity.html#ae793d9adbe16fef402b859ba02bee682
231-
[`ActivityTypes`]: https://discord.com/developers/docs/social-sdk/namespacediscordpp.html#a6c76a8cbbc9270f025fd6854d5558660
279+
[`ActivityTypes`]: https://discord.com/developers/docs/social-sdk/namespacediscordpp.html#a6c76a8cbbc9270f025fd6854d5558660
280+
[`Client::Connect`]: https://discord.com/developers/docs/social-sdk/classdiscordpp_1_1Client.html#a873a844c7c4c72e9e693419bb3e290aa
281+
[`Client::SetApplicationId`]: https://discord.com/developers/docs/social-sdk/classdiscordpp_1_1Client.html#ad452335c06b28be0406dab824acccc49
282+
[`Client::UpdateRichPresence`]: https://discord.com/developers/docs/social-sdk/classdiscordpp_1_1Client.html#af0a85e30f2b3d8a0b502fd23744ee58e

0 commit comments

Comments
 (0)