Skip to content

Update Embedded App SDK docs with relationship features #7547

New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Open
wants to merge 3 commits into
base: main
Choose a base branch
from
Open
Changes from all 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
95 changes: 95 additions & 0 deletions docs/developer-tools/embedded-app-sdk.mdx
Original file line number Diff line number Diff line change
Expand Up @@ -167,6 +167,7 @@ Developers can use these commands to interact with the Discord client. The follo
| [getEntitlements](/docs/developer-tools/embedded-app-sdk#getentitlements) | Returns a list of entitlements for the current user |
| [getInstanceConnectedParticipants](/docs/developer-tools/embedded-app-sdk#getinstanceconnectedparticipants) | Returns all participants connected to the instance |
| [getPlatformBehaviors](/docs/developer-tools/embedded-app-sdk#getplatformbehaviors) | Returns information about supported platform behaviors |
| [getRelationships](/docs/developer-tools/embedded-app-sdk#getrelationships) | Returns the current user's relationships |
| [getSkus](/docs/developer-tools/embedded-app-sdk#getskus) | Returns a list of your app's SKUs |
| [initiateImageUpload](/docs/developer-tools/embedded-app-sdk#initiateimageupload) | Presents the file upload flow in the Discord client |
| [openExternalLink](/docs/developer-tools/embedded-app-sdk#openexternallink) | Allows for opening an external link from within the Discord client |
Expand Down Expand Up @@ -455,6 +456,39 @@ await discordSdk.commands.getPlatformBehaviors();

---


### getRelationships()

Returns the current user's relationships.


#### Supported Platforms
| Web | iOS | Android |
|-----|-----|---------|
| ✅ | ✅ | ✅ |

#### Required Scopes

- relationships.read

:::info
Requires Discord approval
:::

#### Signature

<Monospace>
getRelationships(): Promise\<[GetRelationshipsResponse](/docs/developer-tools/embedded-app-sdk#getrelationshipsresponse)\>
</Monospace>

#### Usage

```js
await discordSdk.commands.getRelationships();
```

---

### getSkus()

Returns a list of SKU objects. SKUs without prices are automatically filtered out.
Expand Down Expand Up @@ -795,6 +829,7 @@ Developers may use the following events alongside the `subscribe()` SDK method t
| [CURRENT_GUILD_MEMBER_UPDATE](/docs/developer-tools/embedded-app-sdk#currentguildmemberupdate) | Received when the current guild member object changes |
| [THERMAL_STATE_UPDATE](/docs/developer-tools/embedded-app-sdk#thermalstateupdate) | Received when Android or iOS thermal states are surfaced to the Discord app |
| [ACTIVITY_INSTANCE_PARTICIPANTS_UPDATE](/docs/developer-tools/embedded-app-sdk#activityinstanceparticipantsupdate) | Received when the number of instance participants changes |
| [RELATIONSHIP_UPDATE](/docs/developer-tools/embedded-app-sdk#relationshipupdate) | Received when a relationship of the current user is updated |
| [ENTITLEMENT_CREATE](/docs/developer-tools/embedded-app-sdk#entitlementcreate) | Received when an entitlement is created for a SKU |


Expand Down Expand Up @@ -1054,6 +1089,41 @@ No scopes required

---

### RELATIONSHIP_UPDATE

Received when a relationship of the current user is updated.

#### Required Scopes

- relationships.read

:::info
Requires Discord approval
:::

#### Sample Event Payload
```javascript
{
"type": 1,
"user": {
"id": "7173771622812225536",
"username": "beef_supreme",
"discriminator": "0",
"global_name": "Dis Cord",
"avatar": "abcdefg",
"avatar_decoration_data": {
"asset": "abcdefg",
"sku_id": "123456789"
},
"bot": false,
"flags": 1,
"premium_type": 2
}
}
```

---

### ENTITLEMENT_CREATE

:::preview
Expand Down Expand Up @@ -1302,6 +1372,12 @@ Coming soon! Not available during Developer Preview
|-------------------------|---------|
| iosKeyboardResizesView? | boolean |

#### GetRelationshipsResponse

| Property | Type |
|---------------|-----------------------------------------------------------------------|
| relationships | [Relationship](/docs/developer-tools/embedded-app-sdk#relationship)[] |

#### GetSkusResponse

| Property | Type |
Expand Down Expand Up @@ -1438,6 +1514,13 @@ Coming soon! Not available during Developer Preview
| me | boolean |
| emoji | [Emoji](/docs/developer-tools/embedded-app-sdk#emoji) |

#### Relationship

| Property | Type |
|----------|---------------------------------------------------------------------|
| type | [number](/docs/developer-tools/embedded-app-sdk#relationship-types) |
| user | [User](/docs/developer-tools/embedded-app-sdk#user) |

#### Secrets

| Property | Type |
Expand Down Expand Up @@ -1690,3 +1773,15 @@ Coming soon! Not available during Developer Preview
| CONSUMABLE | 3 |
| BUNDLE | 4 |
| SUBSCRIPTION | 5 |

#### Relationship Types

| Value | Name | Description |
|-------|------------------|--------------------------------------------------------------------------------------------------|
| 0 | None | The user has no relationship with the other user. |
| 1 | Friend | The user is friends with the other user. |
| 2 | Blocked | The current user has blocked the target user. |
| 3 | Pending Incoming | The current user has received a friend request from the target user, but it is not yet accepted. |
| 4 | Pending Outgoing | The current user has sent a friend request to the target user, but it is not yet accepted. |
| 5 | Implicit | The Implicit type is documented for visibility, but should be unused in the SDK. |
| 6 | Suggestion | The Suggestion type is documented for visibility, but should be unused in the SDK. |