From 2e0eff3f7ef46fd9c13b0d66f5e29490e6192454 Mon Sep 17 00:00:00 2001 From: Mark Mandel Date: Mon, 14 Apr 2025 23:33:37 +0000 Subject: [PATCH 1/3] Discord Social SDK 1.1 Release This PR includes changelog and related updates to documentation so it can be merged atomically. Details include: * The changelog for the release. * Updated mappings for doxygen docs. * Updated Provisional Account docs for Unity Services. * Added links on Provisional Account docs to all other services. * Add PlayStation4 and Xbox One support to supported platforms list. * Trailing spaces cleanup. --- .../2025-04-11-discord-social-sdk-1.1.md | 51 +++++++++++++++++++ docs/discord-social-sdk/core-concepts.mdx | 5 +- .../using-provisional-accounts.mdx | 23 ++++++--- package-lock.json | 28 ++++++++++ package.json | 3 ++ tools/doxygen/social-sdk-mappings.json | 5 ++ 6 files changed, 106 insertions(+), 9 deletions(-) create mode 100644 docs/change-log/2025-04-11-discord-social-sdk-1.1.md diff --git a/docs/change-log/2025-04-11-discord-social-sdk-1.1.md b/docs/change-log/2025-04-11-discord-social-sdk-1.1.md new file mode 100644 index 0000000000..f37449b2d6 --- /dev/null +++ b/docs/change-log/2025-04-11-discord-social-sdk-1.1.md @@ -0,0 +1,51 @@ +--- +title: "Discord Social SDK Release 1.1" +date: "2025-04-11" +topics: + - "Discord Social SDK" +--- + +A new release of the Discord Social SDK is now available, with the following updates: + +### Platforms + +- Added Xbox One and PS4 console support + +### Auth + +- Added support for Unity Services as an external auth provider + +### Voice +- [`Client::StartCallWithAudioCallbacks`] now permits sample data to be modified during record and + playback for custom effects processing +- Fixed a bug where the speaking state for a user could be stuck in the "on" state +- Added [`Call::GetPTTReleaseDelay`] +- Initialization of the voice engine is now delayed until it's needed +- Fixed a deadlock with the Linux PulseAudio backend where malfunctioning audio devices could cause a voice engine + lockup + +### Rich Presence + +- Added support for sending rich presence updates and invites without connecting to the Discord gateway on desktop + +### Misc + +- Added Linux support for [`Client::RegisterLaunchCommand`] and + [`Client::RegisterLaunchSteamApplication`] +- Fixed a crash when a Unity Editor scripting domain reload (e.g. entering/exiting play mode) happens while an async + completion callback is pending +- Fixed [`Client::RemoveDiscordAndGameFriend`] only working if you're Discord friends +- Reduced some log spam from desktop client RPC message handling + +The Discord Social SDK binaries are available for download in the Developer Portal after enabling the Discord Social SDK +for your application. + +To learn more about building with the Discord Social SDK, check out +the [Discord Social SDK Overview](#DOCS_DISCORD_SOCIAL_SDK_OVERVIEW). + + +[`Call::GetPTTReleaseDelay`]: https://discord.com/developers/docs/social-sdk/classdiscordpp_1_1Call.html#ab8dc6b1527728fecb17f266d5b3e9e6e +[`Client::RegisterLaunchCommand`]: https://discord.com/developers/docs/social-sdk/classdiscordpp_1_1Client.html#a024d7222931fdcb7d09c2b107642ecab +[`Client::RegisterLaunchSteamApplication`]: https://discord.com/developers/docs/social-sdk/classdiscordpp_1_1Client.html#a45b2c791c5b06f77d457dacb53dfba40 +[`Client::RemoveDiscordAndGameFriend`]: https://discord.com/developers/docs/social-sdk/classdiscordpp_1_1Client.html#aa6d393a3d98ec5d06faef49a57d1a89b +[`Client::StartCallWithAudioCallbacks`]: https://discord.com/developers/docs/social-sdk/classdiscordpp_1_1Client.html#abcaa891769f9e912bfa0e06ff7221b05 \ No newline at end of file diff --git a/docs/discord-social-sdk/core-concepts.mdx b/docs/discord-social-sdk/core-concepts.mdx index 1a8c706a04..5b48a9f42c 100644 --- a/docs/discord-social-sdk/core-concepts.mdx +++ b/docs/discord-social-sdk/core-concepts.mdx @@ -72,11 +72,12 @@ The Discord Social SDK is available for the following platforms: ### Console (full console support & guides coming soon) -- **Xbox Series X|S** + +- **Xbox Series X|S and Xbox One** - Standalone C++ - Unreal Engine - Unity -- **PlayStation5** +- **PlayStation5 and PlayStation4** - Standalone C++ - Unreal Engine - Unity diff --git a/docs/discord-social-sdk/development-guides/using-provisional-accounts.mdx b/docs/discord-social-sdk/development-guides/using-provisional-accounts.mdx index 5be4538896..45ba0eefd9 100644 --- a/docs/discord-social-sdk/development-guides/using-provisional-accounts.mdx +++ b/docs/discord-social-sdk/development-guides/using-provisional-accounts.mdx @@ -10,7 +10,7 @@ import SupportCallout from '../partials/callouts/support.mdx'; ## Overview -Provisional accounts let players use Social SDK features in your game without linking a Discord account so all players can have a consistent gameplay experience. +Provisional accounts let players use Social SDK features in your game without linking a Discord account so all players can have a consistent gameplay experience. With provisional accounts, players can: @@ -25,7 +25,7 @@ This guide will show you how to: 1. Set up provisional accounts for your game 2. Create and manage provisional accounts -3. Handle account merging when users want to upgrade to full Discord +3. Handle account merging when users want to upgrade to full Discord ## Prerequisites @@ -121,7 +121,7 @@ The callback function will be invoked with an access token that expires in 1 hou You can use [`Client::SetTokenExpirationCallback`] to receive a callback when the current token is about to expire or expires. -> info +> info > When the token expires, the SDK will still receive updates, such as new messages sent in a lobby, and any voice calls will continue to be active. However, any new actions, such as sending a message or adding a friend, will fail. You can get a new token and pass it to UpdateToken without interrupting the user's experience. #### Provisional Account Access Token Storage @@ -140,6 +140,7 @@ If you are not using the [`Client::GetProvisionalToken`] method, you'll need to | STEAM_SESSION_TICKET | A Steam auth ticket for web generated with discord as the identity | | EPIC_ONLINE_SERVICES_ACCESS_TOKEN | Access token for Epic Online Services. Supports EOS Auth access tokens | | EPIC_ONLINE_SERVICES_ID_TOKEN | ID token for Epic Online Services. Supports both EOS Auth + Connect ID tokens | +| UNITY_SERVICES_ID_TOKEN | Unity Services authentication ID token | ```python @@ -192,9 +193,17 @@ Common error codes and solutions for the GetProvisionalToken method: Using these credentials, we'll create a limited Discord account just for your game and try to set the username for you according to the following: -- For OIDC, a provisional account's display name will be the value of the preferred_username claim, if specified in the ID token. This field is optional and should be between 1 and 32 characters. If not specified, the user's display name will default to the user's unique username, which Discord generates on creation. -- For Steam session tickets, the display name of the user's Steam account is used as the provisional account's display name. -- For EOS Auth Access Tokens or ID Tokens, the name of the user's Epic account is used as the provisional account's display name. EOS Connect ID Tokens do not expose any username, and thus the game will need to configure the display name with [`Client::UpdateProvisionalAccountDisplayName`]. +- For OIDC, a provisional account's display name will be the value of the preferred_username claim, if specified in the + ID token. This field is optional and should be between 1 and 32 characters. If not specified, the user's display + name will default to the user's unique username, which Discord generates on creation. +- For [Steam session tickets](https://partner.steamgames.com/doc/features/auth), the display name of the user's Steam + account is used as the provisional account's display name. +- For [EOS Auth Access](https://dev.epicgames.com/docs/epic-account-services/auth/auth-interface) Tokens or ID Tokens, + the name of the user's Epic account is used as the provisional account's display name. EOS Connect ID Tokens do + not expose any username, and thus the game will need to configure the display name with + [`Client::UpdateProvisionalAccountDisplayName`]. +- For [Unity Services ID Tokens](https://docs.unity.com/ugs/en-us/manual/authentication/manual/unity-player-accounts), + the display name of the user's Unity Player Account is used as the provisional account's display name. If you'd like to set the display name for a provisional account, you can use the [`Client::UpdateProvisionalAccountDisplayName`] method. @@ -390,7 +399,7 @@ Now that you've set up provisional accounts for your game, you can explore more Display game status and information to Discord friends. - + diff --git a/package-lock.json b/package-lock.json index 627ba0ef1d..4f1cf6d4da 100644 --- a/package-lock.json +++ b/package-lock.json @@ -8,6 +8,9 @@ "name": "discord-api-docs", "version": "1.1.1", "license": "MIT", + "dependencies": { + "xml2js": "^0.6.2" + }, "devDependencies": { "@actions/core": "^1.10.1", "@eslint/js": "^9.2.0", @@ -3421,6 +3424,11 @@ "queue-microtask": "^1.2.2" } }, + "node_modules/sax": { + "version": "1.4.1", + "resolved": "https://registry.npmjs.org/sax/-/sax-1.4.1.tgz", + "integrity": "sha512-+aWOz7yVScEGoKNd4PA10LZ8sk0A/z5+nXQG5giUO5rprX9jgYsTdov9qCchZiPIZezbZH+jRut8nPodFAX4Jg==" + }, "node_modules/semver": { "version": "7.6.2", "resolved": "https://registry.npmjs.org/semver/-/semver-7.6.2.tgz", @@ -4088,6 +4096,26 @@ "url": "https://github.com/chalk/strip-ansi?sponsor=1" } }, + "node_modules/xml2js": { + "version": "0.6.2", + "resolved": "https://registry.npmjs.org/xml2js/-/xml2js-0.6.2.tgz", + "integrity": "sha512-T4rieHaC1EXcES0Kxxj4JWgaUQHDk+qwHcYOCFHfiwKz7tOVPLq7Hjq9dM1WCMhylqMEfP7hMcOIChvotiZegA==", + "dependencies": { + "sax": ">=0.6.0", + "xmlbuilder": "~11.0.0" + }, + "engines": { + "node": ">=4.0.0" + } + }, + "node_modules/xmlbuilder": { + "version": "11.0.1", + "resolved": "https://registry.npmjs.org/xmlbuilder/-/xmlbuilder-11.0.1.tgz", + "integrity": "sha512-fDlsI/kFEx7gLvbecc0/ohLG50fugQp8ryHzMTuW9vSa1GJ0XYWKnhsUx7oie3G98+r56aTQIUB4kht42R3JvA==", + "engines": { + "node": ">=4.0" + } + }, "node_modules/yocto-queue": { "version": "0.1.0", "resolved": "https://registry.npmjs.org/yocto-queue/-/yocto-queue-0.1.0.tgz", diff --git a/package.json b/package.json index 248ec90c47..3283894b65 100644 --- a/package.json +++ b/package.json @@ -51,5 +51,8 @@ "tsx": "^4.10.2", "typescript": "^5.4.5", "typescript-eslint": "^8.0.0-alpha.12" + }, + "dependencies": { + "xml2js": "^0.6.2" } } diff --git a/tools/doxygen/social-sdk-mappings.json b/tools/doxygen/social-sdk-mappings.json index 7835f0072f..e5da83f0ae 100644 --- a/tools/doxygen/social-sdk-mappings.json +++ b/tools/doxygen/social-sdk-mappings.json @@ -49,6 +49,8 @@ "discordpp::ActivityInvite::SetApplicationId": "https://discord.com/developers/docs/social-sdk/classdiscordpp_1_1ActivityInvite.html#a660bc6a697802fae9a3bdc3f11c8ed6b", "discordpp::ActivityInvite::PartyId": "https://discord.com/developers/docs/social-sdk/classdiscordpp_1_1ActivityInvite.html#ab4d0b0ccc568941375458518fb571176", "discordpp::ActivityInvite::SetPartyId": "https://discord.com/developers/docs/social-sdk/classdiscordpp_1_1ActivityInvite.html#ad538b78267ff9114f43244e3eb28f92e", + "discordpp::ActivityInvite::SessionId": "https://discord.com/developers/docs/social-sdk/classdiscordpp_1_1ActivityInvite.html#a0c947f356db2b20a68a9ad536bbd4f5c", + "discordpp::ActivityInvite::SetSessionId": "https://discord.com/developers/docs/social-sdk/classdiscordpp_1_1ActivityInvite.html#a2a5326a8dbca7f97509dc7c1fc21a25a", "discordpp::ActivityInvite::IsValid": "https://discord.com/developers/docs/social-sdk/classdiscordpp_1_1ActivityInvite.html#a92e24e683870b13e8f464d6b93312433", "discordpp::ActivityInvite::SetIsValid": "https://discord.com/developers/docs/social-sdk/classdiscordpp_1_1ActivityInvite.html#a204f3077312a695ec2fea5f3f1430c2d", "discordpp::ActivityParty::ActivityParty": "https://discord.com/developers/docs/social-sdk/classdiscordpp_1_1ActivityParty.html#a791f8f4407e9c1d91dc99c71cb135457", @@ -134,6 +136,7 @@ "discordpp::Call::GetParticipants": "https://discord.com/developers/docs/social-sdk/classdiscordpp_1_1Call.html#acbbbfad47511535755cb55631a8c9922", "discordpp::Call::GetParticipantVolume": "https://discord.com/developers/docs/social-sdk/classdiscordpp_1_1Call.html#aeff7fa60c6029ffde272160bf1f16748", "discordpp::Call::GetPTTActive": "https://discord.com/developers/docs/social-sdk/classdiscordpp_1_1Call.html#a48e2d2809e8787178bec44c946b31328", + "discordpp::Call::GetPTTReleaseDelay": "https://discord.com/developers/docs/social-sdk/classdiscordpp_1_1Call.html#ab8dc6b1527728fecb17f266d5b3e9e6e", "discordpp::Call::GetSelfDeaf": "https://discord.com/developers/docs/social-sdk/classdiscordpp_1_1Call.html#a7ea04973139a803d198661874eb13786", "discordpp::Call::GetSelfMute": "https://discord.com/developers/docs/social-sdk/classdiscordpp_1_1Call.html#ad2305065d5e633678c9242ed886e65e2", "discordpp::Call::GetStatus": "https://discord.com/developers/docs/social-sdk/classdiscordpp_1_1Call.html#ad614dfd6578370a0d9b73b40db1e780f", @@ -237,6 +240,7 @@ "discordpp::Client::Connect": "https://discord.com/developers/docs/social-sdk/classdiscordpp_1_1Client.html#a873a844c7c4c72e9e693419bb3e290aa", "discordpp::Client::Disconnect": "https://discord.com/developers/docs/social-sdk/classdiscordpp_1_1Client.html#a115b0be168a18da1119e522abaa92106", "discordpp::Client::GetStatus": "https://discord.com/developers/docs/social-sdk/classdiscordpp_1_1Client.html#aff09cced22a1b08cbd85b3ef25aa5f22", + "discordpp::Client::SetApplicationId": "https://discord.com/developers/docs/social-sdk/classdiscordpp_1_1Client.html#ad452335c06b28be0406dab824acccc49", "discordpp::Client::SetLogDir": "https://discord.com/developers/docs/social-sdk/classdiscordpp_1_1Client.html#a23bd5802dfa3072201ea864ee839c001", "discordpp::Client::SetStatusChangedCallback": "https://discord.com/developers/docs/social-sdk/classdiscordpp_1_1Client.html#a9d0e8824570b93149d5d1c65bb3fb97f", "discordpp::Client::SetVoiceLogDir": "https://discord.com/developers/docs/social-sdk/classdiscordpp_1_1Client.html#a48c6b7e8bbc2b632a935acafc6a5f7a7", @@ -296,6 +300,7 @@ "discordpp::Client::Client": "https://discord.com/developers/docs/social-sdk/classdiscordpp_1_1Client.html#a302dda8b19408696fa186e739c5c24c8", "discordpp::Client::operator=": "https://discord.com/developers/docs/social-sdk/classdiscordpp_1_1Client.html#a8c02c2584b09be381cb519ec8951ebcc", "discordpp::Client::operator bool": "https://discord.com/developers/docs/social-sdk/classdiscordpp_1_1Client.html#ad35d2a626e64f4313883ce22cd45efb7", + "discordpp::Client::GetApplicationId": "https://discord.com/developers/docs/social-sdk/classdiscordpp_1_1Client.html#abe66dd4bf3cbc27961d41e8e11015ff5", "discordpp::Client::ErrorToString": "https://discord.com/developers/docs/social-sdk/classdiscordpp_1_1Client.html#ab40c4c45450eb5d5f14346612b57ddae", "discordpp::Client::GetDefaultAudioDeviceId": "https://discord.com/developers/docs/social-sdk/classdiscordpp_1_1Client.html#a91c6f22803d437153ad192f3395ac47c", "discordpp::Client::GetDefaultCommunicationScopes": "https://discord.com/developers/docs/social-sdk/classdiscordpp_1_1Client.html#a71499da752fbdc2d4326ae0fd36c0dd1", From 73ee99f55770cf614c6797caa7641622e0f96769 Mon Sep 17 00:00:00 2001 From: Mark Mandel Date: Tue, 15 Apr 2025 22:45:33 +0000 Subject: [PATCH 2/3] Review updates. --- .../development-guides/using-provisional-accounts.mdx | 8 ++++---- 1 file changed, 4 insertions(+), 4 deletions(-) diff --git a/docs/discord-social-sdk/development-guides/using-provisional-accounts.mdx b/docs/discord-social-sdk/development-guides/using-provisional-accounts.mdx index 45ba0eefd9..db8cbe4f5e 100644 --- a/docs/discord-social-sdk/development-guides/using-provisional-accounts.mdx +++ b/docs/discord-social-sdk/development-guides/using-provisional-accounts.mdx @@ -193,16 +193,16 @@ Common error codes and solutions for the GetProvisionalToken method: Using these credentials, we'll create a limited Discord account just for your game and try to set the username for you according to the following: -- For OIDC, a provisional account's display name will be the value of the preferred_username claim, if specified in the - ID token. This field is optional and should be between 1 and 32 characters. If not specified, the user's display +- For OIDC, a provisional account's display name will be the value of the `preferred_username` claim, if specified in + the ID token. This field is optional and should be between 1 and 32 characters. If not specified, the user's display name will default to the user's unique username, which Discord generates on creation. - For [Steam session tickets](https://partner.steamgames.com/doc/features/auth), the display name of the user's Steam account is used as the provisional account's display name. -- For [EOS Auth Access](https://dev.epicgames.com/docs/epic-account-services/auth/auth-interface) Tokens or ID Tokens, +- For [EOS Auth](https://dev.epicgames.com/docs/epic-account-services/auth/auth-interface) Access Tokens or ID Tokens, the name of the user's Epic account is used as the provisional account's display name. EOS Connect ID Tokens do not expose any username, and thus the game will need to configure the display name with [`Client::UpdateProvisionalAccountDisplayName`]. -- For [Unity Services ID Tokens](https://docs.unity.com/ugs/en-us/manual/authentication/manual/unity-player-accounts), +- For [Unity Services ID Tokens](https://services.docs.unity.com/docs/client-auth/), the display name of the user's Unity Player Account is used as the provisional account's display name. If you'd like to set the display name for a provisional account, you can use the [`Client::UpdateProvisionalAccountDisplayName`] method. From 9362136e554c8d8172b91d528eb1ead011dad144 Mon Sep 17 00:00:00 2001 From: Mark Mandel Date: Tue, 15 Apr 2025 22:59:16 +0000 Subject: [PATCH 3/3] Change date, so it displays on top. --- ...d-social-sdk-1.1.md => 2025-04-16-discord-social-sdk-1.1.md} | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) rename docs/change-log/{2025-04-11-discord-social-sdk-1.1.md => 2025-04-16-discord-social-sdk-1.1.md} (99%) diff --git a/docs/change-log/2025-04-11-discord-social-sdk-1.1.md b/docs/change-log/2025-04-16-discord-social-sdk-1.1.md similarity index 99% rename from docs/change-log/2025-04-11-discord-social-sdk-1.1.md rename to docs/change-log/2025-04-16-discord-social-sdk-1.1.md index f37449b2d6..c4761e60b8 100644 --- a/docs/change-log/2025-04-11-discord-social-sdk-1.1.md +++ b/docs/change-log/2025-04-16-discord-social-sdk-1.1.md @@ -1,6 +1,6 @@ --- title: "Discord Social SDK Release 1.1" -date: "2025-04-11" +date: "2025-04-16" topics: - "Discord Social SDK" ---