Skip to content
Merged
Changes from 3 commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
52 changes: 51 additions & 1 deletion docs/developer_tools/Embedded_App_SDK.mdx
Original file line number Diff line number Diff line change
Expand Up @@ -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 |

Expand Down Expand Up @@ -691,6 +692,41 @@ 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

<Monospace>
shareLink(args: [ShareLinkRequest](#DOCS_DEVELOPER_TOOLS_EMBEDDED_APP_SDK/sharelinkrequest)): Promise\<[ShareLinkResponse](#DOCS_DEVELOPER_TOOLS_EMBEDDED_APP_SDK/sharelinkresponse)\>\<void\>
</Monospace>

#### 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.
Expand Down Expand Up @@ -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 |
Expand Down Expand Up @@ -1604,4 +1654,4 @@ No scopes required
| DLC | 2 |
| CONSUMABLE | 3 |
| BUNDLE | 4 |
| SUBSCRIPTION | 5 |
| SUBSCRIPTION | 5 |
Loading