diff --git a/docs/developer_tools/Embedded_App_SDK.mdx b/docs/developer_tools/Embedded_App_SDK.mdx index 2a7938ce3e..bacde5041d 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,39 @@ await discordSdk.commands.setOrientationLockState({ --- + +### shareLink() + +Presents the user with a modal to share 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 +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 +1432,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 +1652,4 @@ No scopes required | DLC | 2 | | CONSUMABLE | 3 | | BUNDLE | 4 | -| SUBSCRIPTION | 5 | \ No newline at end of file +| SUBSCRIPTION | 5 |