Skip to content

Commit cc6135b

Browse files
committed
Clarify User Actions and add required patterns for games
1 parent b420e61 commit cc6135b

File tree

2 files changed

+102
-52
lines changed

2 files changed

+102
-52
lines changed

docs/capabilities/server/userActions.mdx

Lines changed: 51 additions & 26 deletions
Original file line numberDiff line numberDiff line change
@@ -1,7 +1,7 @@
11
import Tabs from '@theme/Tabs';
22
import TabItem from '@theme/TabItem';
33

4-
# User actions
4+
# User Actions
55

66
User actions allow your app to submit posts, submit comments, and subscribe to the current subreddit on behalf of the logged in user. These actions occur on the logged in user's account instead of the app account. This enables stronger user engagement while ensuring user control and transparency.
77

@@ -14,12 +14,10 @@ By default, apps make posts or comments using their associated app account. With
1414
- Create posts or comments on behalf of the user (from the post UI, a form, or a menu action)
1515
- Subscribe the user to the current subreddit
1616

17-
### Unavailable actions
18-
1917
Some actions are not available to apps to prevent abuse and maintain platform integrity:
2018

21-
- **Voting** - Apps cannot upvote or downvote posts or comments, either as the app account or on behalf of the logged-in user
22-
- **Following/friending users** - Apps cannot follow users (on reddit.com) or add friends (on Old Reddit), either as the app account or on behalf of the logged-in user
19+
- Apps cannot upvote or downvote posts or comments, either as the app account or on behalf of the logged-in user
20+
- Apps cannot follow users (on reddit.com) or add friends (on old.reddit.com), either as the app account or on behalf of the logged-in user
2321

2422
---
2523

@@ -30,23 +28,14 @@ To ensure a positive user experience and compliance with Reddit policies:
3028

3129
- **Always ask permission:** Your app must always inform users before posting, commenting, or subscribing on their behalf. This can only happen on an explicit manual action, e.g. from a button.
3230
- **No automated actions:** Users must explicitly opt-in to the app acting on their behalf. Do not mislead or surprise users.
33-
- **Establish a reporting flow:** Ensure `userGeneratedContent` is correctly set for posts submitted on behalf of the user.
34-
- **Do not gate functionality behind subscribing:** Users should not be made to subscribe to the current subreddit to access any part of your app.
35-
- **Remember the human:** Follow Reddit's safety and compliance guidelines for user-generated content.
31+
- **Establish a reporting flow:** Ensure `userGeneratedContent` is correctly set for posts submitted on behalf of the user.
32+
- **Do not gate any functionality:** Users should not be made or encouraged to post, comment, or subscribe to continue using your app.
33+
- **Remember the human:** Follow Reddit's safety and compliance guidelines for user-generated content. Do not create spam-like content or poor user experiences in pursuit of engagement.
3634

3735
:::note
3836
Apps using user actions must follow these requirements to be approved.
3937
:::
4038

41-
---
42-
43-
## How it works
44-
45-
- **Unapproved/playtest apps:**
46-
- `runAs: 'USER'` will operate from the app account unless the app owner takes the action.
47-
- User actions taken by the app owner will be attributed to the app owner's username.
48-
- **Approved apps:**
49-
- After publishing and approval, `runAs: 'USER'` will operate on behalf of the user for all users.
5039

5140
---
5241

@@ -66,28 +55,30 @@ To enable user actions, add the required permissions to your `devvit.json`:
6655
}
6756
```
6857

69-
After enabling, you can call certain Reddit APIs on behalf of the user by passing the option `runAs: 'USER'`.
70-
71-
Currently, the following APIs support this option:
58+
After enabling, you can call certain Reddit APIs on behalf of the user by passing the option `runAs: 'USER'`. The following APIs support this option:
7259

7360
- [submitPost()](../../api/redditapi/RedditAPIClient/classes/RedditAPIClient.md#submitpost)
7461
- [submitCustomPost()](../../api/redditapi/RedditAPIClient/classes/RedditAPIClient.md)
7562
- [submitComment()](../../api/redditapi/RedditAPIClient/classes/RedditAPIClient.md#submitcomment)
7663

7764
If `runAs` is not specified, the API will use `runAs: 'APP'` by default.
7865

79-
---
80-
81-
## Parameters
66+
### Parameters
8267

8368
| Parameter | Description |
8469
| ---------------------- | ------------------------------------------------------------------------------------------------------------------------ |
8570
| `runAs` | The type of account to perform the action on behalf of: `'USER'` or `'APP'`. Defaults to `'APP'`. |
8671
| `userGeneratedContent` | Text or images submitted by the user. Required for `submitPost()` with `runAs: 'USER'` for safety and compliance review. |
8772

88-
:::note
89-
Apps that use `submitPost()` with `runAs: 'USER'` require `userGeneratedContent` to be approved by Reddit.
90-
:::
73+
### Differences during playtesting
74+
75+
Your app version needs to be approved in order for user actions to be enabled for all users. Expect the following behavior:
76+
77+
- **Unapproved/playtest apps:**
78+
- `runAs: 'USER'` will operate from the app account unless the app owner takes the action.
79+
- User actions taken by the app owner will be attributed to the app owner's username.
80+
- **Approved apps:**
81+
- After publishing and approval, `runAs: 'USER'` will operate on behalf of the user for all users.
9182

9283
---
9384

@@ -209,3 +200,37 @@ router.post('/api/subscribe', async (_req, res) => {
209200
</Tabs>
210201

211202
For user privacy there is no API to check if the user is already subscribed to the current subreddit. You may want to store the subscription state in Redis to provide contextually aware UI.
203+
204+
---
205+
206+
## Adding user actions to games
207+
208+
### End-of-game actions
209+
210+
✅ An example of a clear end-of-game layout:
211+
212+
- `Play Again`
213+
- `Comment My Score`
214+
- `Subscribe to r/your_subreddit`
215+
216+
This example keeps each action separate and straightforward for the user. Playing again, commenting, and subscribing are distinct decisions and are therefore presented as distinct actions.
217+
218+
❌ An example of an unclear end-of-game layout:
219+
220+
- `Play Again and Subscribe`
221+
- `Post Score to Play Next Level`
222+
- `Comment & Continue`
223+
224+
This example mixes intention and is confusing for the user. Apps like this that merge functionality (e.g. playing again) with user actions (e.g. subscribing or commenting) will be rejected during review.
225+
226+
### Commenting scores
227+
228+
✅ The required pattern for commenting scores is:
229+
230+
- Commenting after explicit manual action (e.g. from a button)
231+
- Commenting by the user (not the app account)
232+
- Commenting as a reply to a single stickied comment
233+
234+
This avoids surprising the user, enables a reporting flow, and allows the user to easily delete their score comment. Replying to a stickied comment keeps this repetitive content with low discussion value out of the way, in an area that needs to be expanded to view.
235+
236+
If offering a way for the user to add a custom message to their score, the comment can be posted as a top-level comment. This prioritizes human discussion and creates a more engaging comment section.

versioned_docs/version-0.12/capabilities/server/userActions.mdx

Lines changed: 51 additions & 26 deletions
Original file line numberDiff line numberDiff line change
@@ -1,7 +1,7 @@
11
import Tabs from '@theme/Tabs';
22
import TabItem from '@theme/TabItem';
33

4-
# User actions
4+
# User Actions
55

66
User actions allow your app to submit posts, submit comments, and subscribe to the current subreddit on behalf of the logged in user. These actions occur on the logged in user's account instead of the app account. This enables stronger user engagement while ensuring user control and transparency.
77

@@ -14,12 +14,10 @@ By default, apps make posts or comments using their associated app account. With
1414
- Create posts or comments on behalf of the user (from the post UI, a form, or a menu action)
1515
- Subscribe the user to the current subreddit
1616

17-
### Unavailable actions
18-
1917
Some actions are not available to apps to prevent abuse and maintain platform integrity:
2018

21-
- **Voting** - Apps cannot upvote or downvote posts or comments, either as the app account or on behalf of the logged-in user
22-
- **Following/friending users** - Apps cannot follow users (on reddit.com) or add friends (on Old Reddit), either as the app account or on behalf of the logged-in user
19+
- Apps cannot upvote or downvote posts or comments, either as the app account or on behalf of the logged-in user
20+
- Apps cannot follow users (on reddit.com) or add friends (on old.reddit.com), either as the app account or on behalf of the logged-in user
2321

2422
---
2523

@@ -30,23 +28,14 @@ To ensure a positive user experience and compliance with Reddit policies:
3028

3129
- **Always ask permission:** Your app must always inform users before posting, commenting, or subscribing on their behalf. This can only happen on an explicit manual action, e.g. from a button.
3230
- **No automated actions:** Users must explicitly opt-in to the app acting on their behalf. Do not mislead or surprise users.
33-
- **Establish a reporting flow:** Ensure `userGeneratedContent` is correctly set for posts submitted on behalf of the user.
34-
- **Do not gate functionality behind subscribing:** Users should not be made to subscribe to the current subreddit to access any part of your app.
35-
- **Remember the human:** Follow Reddit's safety and compliance guidelines for user-generated content.
31+
- **Establish a reporting flow:** Ensure `userGeneratedContent` is correctly set for posts submitted on behalf of the user.
32+
- **Do not gate any functionality:** Users should not be made or encouraged to post, comment, or subscribe to continue using your app.
33+
- **Remember the human:** Follow Reddit's safety and compliance guidelines for user-generated content. Do not create spam-like content or poor user experiences in pursuit of engagement.
3634

3735
:::note
3836
Apps using user actions must follow these requirements to be approved.
3937
:::
4038

41-
---
42-
43-
## How it works
44-
45-
- **Unapproved/playtest apps:**
46-
- `runAs: 'USER'` will operate from the app account unless the app owner takes the action.
47-
- User actions taken by the app owner will be attributed to the app owner's username.
48-
- **Approved apps:**
49-
- After publishing and approval, `runAs: 'USER'` will operate on behalf of the user for all users.
5039

5140
---
5241

@@ -66,28 +55,30 @@ To enable user actions, add the required permissions to your `devvit.json`:
6655
}
6756
```
6857

69-
After enabling, you can call certain Reddit APIs on behalf of the user by passing the option `runAs: 'USER'`.
70-
71-
Currently, the following APIs support this option:
58+
After enabling, you can call certain Reddit APIs on behalf of the user by passing the option `runAs: 'USER'`. The following APIs support this option:
7259

7360
- [submitPost()](../../api/redditapi/RedditAPIClient/classes/RedditAPIClient.md#submitpost)
7461
- [submitCustomPost()](../../api/redditapi/RedditAPIClient/classes/RedditAPIClient.md)
7562
- [submitComment()](../../api/redditapi/RedditAPIClient/classes/RedditAPIClient.md#submitcomment)
7663

7764
If `runAs` is not specified, the API will use `runAs: 'APP'` by default.
7865

79-
---
80-
81-
## Parameters
66+
### Parameters
8267

8368
| Parameter | Description |
8469
| ---------------------- | ------------------------------------------------------------------------------------------------------------------------ |
8570
| `runAs` | The type of account to perform the action on behalf of: `'USER'` or `'APP'`. Defaults to `'APP'`. |
8671
| `userGeneratedContent` | Text or images submitted by the user. Required for `submitPost()` with `runAs: 'USER'` for safety and compliance review. |
8772

88-
:::note
89-
Apps that use `submitPost()` with `runAs: 'USER'` require `userGeneratedContent` to be approved by Reddit.
90-
:::
73+
### Differences during playtesting
74+
75+
Your app version needs to be approved in order for user actions to be enabled for all users. Expect the following behavior:
76+
77+
- **Unapproved/playtest apps:**
78+
- `runAs: 'USER'` will operate from the app account unless the app owner takes the action.
79+
- User actions taken by the app owner will be attributed to the app owner's username.
80+
- **Approved apps:**
81+
- After publishing and approval, `runAs: 'USER'` will operate on behalf of the user for all users.
9182

9283
---
9384

@@ -209,3 +200,37 @@ router.post('/api/subscribe', async (_req, res) => {
209200
</Tabs>
210201

211202
For user privacy there is no API to check if the user is already subscribed to the current subreddit. You may want to store the subscription state in Redis to provide contextually aware UI.
203+
204+
---
205+
206+
## Adding user actions to games
207+
208+
### End-of-game actions
209+
210+
✅ An example of a clear end-of-game layout:
211+
212+
- `Play Again`
213+
- `Comment My Score`
214+
- `Subscribe to r/your_subreddit`
215+
216+
This example keeps each action separate and straightforward for the user. Playing again, commenting, and subscribing are distinct decisions and are therefore presented as distinct actions.
217+
218+
❌ An example of an unclear end-of-game layout:
219+
220+
- `Play Again and Subscribe`
221+
- `Post Score to Play Next Level`
222+
- `Comment & Continue`
223+
224+
This example mixes intention and is confusing for the user. Apps like this that merge functionality (e.g. playing again) with user actions (e.g. subscribing or commenting) will be rejected during review.
225+
226+
### Commenting scores
227+
228+
✅ The required pattern for commenting scores is:
229+
230+
- Commenting after explicit manual action (e.g. from a button)
231+
- Commenting by the user (not the app account)
232+
- Commenting as a reply to a single stickied comment
233+
234+
This avoids surprising the user, enables a reporting flow, and allows the user to easily delete their score comment. Replying to a stickied comment keeps this repetitive content with low discussion value out of the way, in an area that needs to be expanded to view.
235+
236+
If offering a way for the user to add a custom message to their score, the comment can be posted as a top-level comment. This prioritizes human discussion and creates a more engaging comment section.

0 commit comments

Comments
 (0)