From b3b67624d9b7ade9240db1518290d64728617362 Mon Sep 17 00:00:00 2001 From: Andrew Giel Date: Fri, 10 Jan 2025 12:46:06 -0500 Subject: [PATCH 1/5] add simple embedded app sdk shareLink docs --- docs/developer_tools/Embedded_App_SDK.mdx | 52 ++++++++++++++++++++++- 1 file changed, 51 insertions(+), 1 deletion(-) diff --git a/docs/developer_tools/Embedded_App_SDK.mdx b/docs/developer_tools/Embedded_App_SDK.mdx index 2a7938ce3e..9f7de46564 100644 --- a/docs/developer_tools/Embedded_App_SDK.mdx +++ b/docs/developer_tools/Embedded_App_SDK.mdx @@ -175,6 +175,7 @@ Developers can use these commands to interact with the Discord client. The follo | [setActivity](#DOCS_DEVELOPER_TOOLS_EMBEDDED_APP_SDK/setactivity) | Modifies how your activity's rich presence is displayed in the Discord client | | [setConfig](#DOCS_DEVELOPER_TOOLS_EMBEDDED_APP_SDK/setconfig) | Set whether or not the PIP (picture-in-picture) is interactive | | [setOrientationLockState](#DOCS_DEVELOPER_TOOLS_EMBEDDED_APP_SDK/setorientationlockstate) | Set options for orientation and picture-in-picture (PIP) modes | +| [shareLink](#DOCS_DEVELOPER_TOOLS_EMBEDDED_APP_SDK/sharelink) | Presents a modal for the user to share a link to your activity with custom query params | | [startPurchase](#DOCS_DEVELOPER_TOOLS_EMBEDDED_APP_SDK/startpurchase) | Launches the purchase flow for a specific SKU, per the sku_id | | [userSettingsGetLocale](#DOCS_DEVELOPER_TOOLS_EMBEDDED_APP_SDK/usersettingsgetlocale) | Returns the current user's locale | @@ -691,6 +692,41 @@ await discordSdk.commands.setOrientationLockState({ --- + +### shareLink() + +Presents the user with a modal to sahre a link + +#### Supported Platforms +| Web | iOS | Android | +|-----|-----|---------| +| ✅ | ⛔️ | ⛔️ | + +#### Required Scopes + +No scopes required + +#### Signature + + +shareLink(args: [ShareLinkRequest](#DOCS_DEVELOPER_TOOLS_EMBEDDED_APP_SDK/sharelinkrequest)): Promise\<[ShareLinkResponse](#DOCS_DEVELOPER_TOOLS_EMBEDDED_APP_SDK/sharelinkresponse)\>\ + + +#### Usage + +```js +import {Common} from '@discord/embedded-app-sdk'; + +const { success } = await discordSdk.commands.shareLink({ + message: 'This message is shared alongside the link!', + referrer_id: 'some_referrer_id', + custom_id: 'some_custom_id', +}); +success ? console.log('User shared link!') : console.log('User did not share link!'); +``` + +--- + ### startPurchase() Launches the purchase flow for a specific SKU ID. @@ -1398,6 +1434,20 @@ No scopes required | picture_in_picture_lock_state | [OrientationLockState](#DOCS_DEVELOPER_TOOLS_EMBEDDED_APP_SDK/orientationlockstatetypeobject) | | grid_lock_state | [OrientationLockState](#DOCS_DEVELOPER_TOOLS_EMBEDDED_APP_SDK/orientationlockstatetypeobject) | +#### ShareLinkRequest + +| Property | Type | +|---------------------|----------------| +| message | string \| null | +| referrer_id | string \| null | +| custom_id | string \| null | + +#### ShareLinkResponse + +| Property | Type | +|----------|---------| +| success | boolean | + #### Sku | Property | Type | @@ -1604,4 +1654,4 @@ No scopes required | DLC | 2 | | CONSUMABLE | 3 | | BUNDLE | 4 | -| SUBSCRIPTION | 5 | \ No newline at end of file +| SUBSCRIPTION | 5 | From df6e3096c49dc599047efa08cd4d99f0fbb082eb Mon Sep 17 00:00:00 2001 From: Andrew Giel Date: Fri, 10 Jan 2025 12:53:53 -0500 Subject: [PATCH 2/5] npm run fix:tables --- docs/developer_tools/Embedded_App_SDK.mdx | 12 ++++++------ 1 file changed, 6 insertions(+), 6 deletions(-) diff --git a/docs/developer_tools/Embedded_App_SDK.mdx b/docs/developer_tools/Embedded_App_SDK.mdx index 9f7de46564..2e621e8396 100644 --- a/docs/developer_tools/Embedded_App_SDK.mdx +++ b/docs/developer_tools/Embedded_App_SDK.mdx @@ -700,7 +700,7 @@ Presents the user with a modal to sahre a link #### Supported Platforms | Web | iOS | Android | |-----|-----|---------| -| ✅ | ⛔️ | ⛔️ | +| ✅ | ⛔️ | ⛔️ | #### Required Scopes @@ -1436,11 +1436,11 @@ No scopes required #### ShareLinkRequest -| Property | Type | -|---------------------|----------------| -| message | string \| null | -| referrer_id | string \| null | -| custom_id | string \| null | +| Property | Type | +|-------------|----------------| +| message | string \| null | +| referrer_id | string \| null | +| custom_id | string \| null | #### ShareLinkResponse From 84f1b3e4c678bfe8fe34a1382c98a27ca8f8672a Mon Sep 17 00:00:00 2001 From: Andrew Giel Date: Fri, 10 Jan 2025 13:58:07 -0500 Subject: [PATCH 3/5] Update docs/developer_tools/Embedded_App_SDK.mdx Co-authored-by: Colin Loretz --- docs/developer_tools/Embedded_App_SDK.mdx | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/docs/developer_tools/Embedded_App_SDK.mdx b/docs/developer_tools/Embedded_App_SDK.mdx index 2e621e8396..c5e838b584 100644 --- a/docs/developer_tools/Embedded_App_SDK.mdx +++ b/docs/developer_tools/Embedded_App_SDK.mdx @@ -695,7 +695,7 @@ await discordSdk.commands.setOrientationLockState({ ### shareLink() -Presents the user with a modal to sahre a link +Presents the user with a modal to share a link #### Supported Platforms | Web | iOS | Android | From 4093236925450e6703a5c7b6f1565455f25b6c85 Mon Sep 17 00:00:00 2001 From: Andrew Giel Date: Fri, 10 Jan 2025 17:25:47 -0500 Subject: [PATCH 4/5] Update docs/developer_tools/Embedded_App_SDK.mdx Co-authored-by: Colin Loretz --- docs/developer_tools/Embedded_App_SDK.mdx | 1 - 1 file changed, 1 deletion(-) diff --git a/docs/developer_tools/Embedded_App_SDK.mdx b/docs/developer_tools/Embedded_App_SDK.mdx index c5e838b584..420292e431 100644 --- a/docs/developer_tools/Embedded_App_SDK.mdx +++ b/docs/developer_tools/Embedded_App_SDK.mdx @@ -715,7 +715,6 @@ shareLink(args: [ShareLinkRequest](#DOCS_DEVELOPER_TOOLS_EMBEDDED_APP_SDK/sharel #### Usage ```js -import {Common} from '@discord/embedded-app-sdk'; const { success } = await discordSdk.commands.shareLink({ message: 'This message is shared alongside the link!', From 7b48745bc7eb9bc70d84c81e5f3e1fcaf72b64a7 Mon Sep 17 00:00:00 2001 From: Andrew Giel Date: Fri, 10 Jan 2025 17:25:54 -0500 Subject: [PATCH 5/5] Update docs/developer_tools/Embedded_App_SDK.mdx Co-authored-by: Colin Loretz --- docs/developer_tools/Embedded_App_SDK.mdx | 1 - 1 file changed, 1 deletion(-) diff --git a/docs/developer_tools/Embedded_App_SDK.mdx b/docs/developer_tools/Embedded_App_SDK.mdx index 420292e431..bacde5041d 100644 --- a/docs/developer_tools/Embedded_App_SDK.mdx +++ b/docs/developer_tools/Embedded_App_SDK.mdx @@ -715,7 +715,6 @@ shareLink(args: [ShareLinkRequest](#DOCS_DEVELOPER_TOOLS_EMBEDDED_APP_SDK/sharel #### Usage ```js - const { success } = await discordSdk.commands.shareLink({ message: 'This message is shared alongside the link!', referrer_id: 'some_referrer_id',