Skip to content

Commit b3b6762

Browse files
committed
add simple embedded app sdk shareLink docs
1 parent 4000472 commit b3b6762

File tree

1 file changed

+51
-1
lines changed

1 file changed

+51
-1
lines changed

docs/developer_tools/Embedded_App_SDK.mdx

Lines changed: 51 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -175,6 +175,7 @@ Developers can use these commands to interact with the Discord client. The follo
175175
| [setActivity](#DOCS_DEVELOPER_TOOLS_EMBEDDED_APP_SDK/setactivity) | Modifies how your activity's rich presence is displayed in the Discord client |
176176
| [setConfig](#DOCS_DEVELOPER_TOOLS_EMBEDDED_APP_SDK/setconfig) | Set whether or not the PIP (picture-in-picture) is interactive |
177177
| [setOrientationLockState](#DOCS_DEVELOPER_TOOLS_EMBEDDED_APP_SDK/setorientationlockstate) | Set options for orientation and picture-in-picture (PIP) modes |
178+
| [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 |
178179
| [startPurchase](#DOCS_DEVELOPER_TOOLS_EMBEDDED_APP_SDK/startpurchase) | Launches the purchase flow for a specific SKU, per the sku_id |
179180
| [userSettingsGetLocale](#DOCS_DEVELOPER_TOOLS_EMBEDDED_APP_SDK/usersettingsgetlocale) | Returns the current user's locale |
180181

@@ -691,6 +692,41 @@ await discordSdk.commands.setOrientationLockState({
691692

692693
---
693694

695+
696+
### shareLink()
697+
698+
Presents the user with a modal to sahre a link
699+
700+
#### Supported Platforms
701+
| Web | iOS | Android |
702+
|-----|-----|---------|
703+
|| ⛔️ | ⛔️ |
704+
705+
#### Required Scopes
706+
707+
No scopes required
708+
709+
#### Signature
710+
711+
<Monospace>
712+
shareLink(args: [ShareLinkRequest](#DOCS_DEVELOPER_TOOLS_EMBEDDED_APP_SDK/sharelinkrequest)): Promise\<[ShareLinkResponse](#DOCS_DEVELOPER_TOOLS_EMBEDDED_APP_SDK/sharelinkresponse)\>\<void\>
713+
</Monospace>
714+
715+
#### Usage
716+
717+
```js
718+
import {Common} from '@discord/embedded-app-sdk';
719+
720+
const { success } = await discordSdk.commands.shareLink({
721+
message: 'This message is shared alongside the link!',
722+
referrer_id: 'some_referrer_id',
723+
custom_id: 'some_custom_id',
724+
});
725+
success ? console.log('User shared link!') : console.log('User did not share link!');
726+
```
727+
728+
---
729+
694730
### startPurchase()
695731

696732
Launches the purchase flow for a specific SKU ID.
@@ -1398,6 +1434,20 @@ No scopes required
13981434
| picture_in_picture_lock_state | [OrientationLockState](#DOCS_DEVELOPER_TOOLS_EMBEDDED_APP_SDK/orientationlockstatetypeobject) |
13991435
| grid_lock_state | [OrientationLockState](#DOCS_DEVELOPER_TOOLS_EMBEDDED_APP_SDK/orientationlockstatetypeobject) |
14001436

1437+
#### ShareLinkRequest
1438+
1439+
| Property | Type |
1440+
|---------------------|----------------|
1441+
| message | string \| null |
1442+
| referrer_id | string \| null |
1443+
| custom_id | string \| null |
1444+
1445+
#### ShareLinkResponse
1446+
1447+
| Property | Type |
1448+
|----------|---------|
1449+
| success | boolean |
1450+
14011451
#### Sku
14021452

14031453
| Property | Type |
@@ -1604,4 +1654,4 @@ No scopes required
16041654
| DLC | 2 |
16051655
| CONSUMABLE | 3 |
16061656
| BUNDLE | 4 |
1607-
| SUBSCRIPTION | 5 |
1657+
| SUBSCRIPTION | 5 |

0 commit comments

Comments
 (0)