Skip to content

Commit cdc0e0d

Browse files
authored
Add requirements for User Actions (#31)
Updates the User Actions documentation with required expectations for App Review.
1 parent 6f53408 commit cdc0e0d

2 files changed

Lines changed: 47 additions & 51 deletions

File tree

docs/capabilities/server/userActions.md

Lines changed: 23 additions & 25 deletions
Original file line numberDiff line numberDiff line change
@@ -1,6 +1,6 @@
11
# User Actions
22

3-
User actions allow your app to perform certain actions—such as creating posts, comments, or subscribing to subreddits—on behalf of the user, rather than the app account. This enables stronger user engagement while ensuring user control and transparency.
3+
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.
44

55
---
66

@@ -13,17 +13,19 @@ By default, apps make posts or comments using their associated app account. With
1313

1414
---
1515

16-
## Guidelines
16+
Requirements
17+
--------------
1718

1819
To ensure a positive user experience and compliance with Reddit policies:
1920

20-
- **Be transparent:** Inform users and show them the content that will be posted on their behalf.
21-
- **No auto-creation:** Users must opt in to allow the app to post or comment on their behalf. This can only happen on an explicit action.
22-
- **Provide user control:** If you are relying on persistent user opt-in, you must make it clear on how the user can opt-out.
23-
21+
- **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.
22+
- **No automated actions:** Users must explicitly opt-in to the app acting on their behalf. Do not mislead or surprise users.
23+
- **Establish a reporting flow:** Ensure `userGeneratedContent` is correctly set for posts submitted on behalf of the user.
24+
- **Do not gate functionality behind subscribing:** Users should not be made to subscribe to the current subreddit to access any part of your app.
25+
- **Remember the human:** Follow Reddit's safety and compliance guidelines for user-generated content.
2426

2527
:::note
26-
Apps using user actions must follow these guidelines to be approved.
28+
Apps using user actions must follow these requirements to be approved.
2729
:::
2830

2931
---
@@ -59,6 +61,7 @@ After enabling, you can call certain Reddit APIs on behalf of the user by passin
5961
Currently, the following APIs support this option:
6062

6163
- [submitPost()](../../api/redditapi/RedditAPIClient/classes/RedditAPIClient.md#submitpost)
64+
- [submitCustomPost()](../../api/redditapi/RedditAPIClient/classes/RedditAPIClient.md#submitcustompost)
6265
- [submitComment()](../../api/redditapi/RedditAPIClient/classes/RedditAPIClient.md#submitcomment)
6366

6467
If `runAs` is not specified, the API will use `runAs: 'APP'` by default.
@@ -100,8 +103,8 @@ router.post('/internal/post-create', async (_req, res) => {
100103
text: "Hello there! This is a new post from the user's account",
101104
},
102105
subredditName,
103-
title: 'Post Title'
104-
entry: 'default',
106+
title: 'Post Title',
107+
entry: 'default',
105108
});
106109

107110
res.json({ status: 'success', message: `Post created in subreddit ${subredditName}` });
@@ -110,26 +113,21 @@ router.post('/internal/post-create', async (_req, res) => {
110113

111114
---
112115

113-
## Example: Subscribe to subreddit
116+
## Example: Subscribe to current subreddit
114117

115-
The subscribe API does not take a `runAs` parameter; it subscribes as the user by default (if specified in `devvit.json` and approved).
118+
The [subscribeToCurrentSubreddit()](../../api/redditapi/RedditAPIClient/classes/RedditAPIClient.md#subscribetocurrentsubreddit) API does not take a `runAs` parameter; it subscribes as the user by default (if specified in `devvit.json` and approved).
116119

117120
```ts
118121
import { reddit } from '@devvit/web/server';
119122

120-
await reddit.subscribeToCurrentSubreddit();
123+
router.post('/api/subscribe', async (_req, res) => {
124+
try {
125+
await reddit.subscribeToCurrentSubreddit();
126+
res.json({ status: 'success' });
127+
} catch (error) {
128+
res.status(500).json({ status: 'error', message: 'Failed to subscribe' });
129+
}
130+
});
121131
```
122132

123-
:::note
124-
There is no API to check if the user is already subscribed to the subreddit. You may want to store the subscription state in Redis to provide contextually aware UI.
125-
:::
126-
127-
---
128-
129-
## Best practices
130-
131-
- Always inform users before posting or commenting on their behalf.
132-
- Require explicit user opt-in for all user actions.
133-
- Use `userGeneratedContent` for all user-submitted posts.
134-
- Store user consent and subscription state if needed for your app's UX.
135-
- Follow Reddit's safety and compliance guidelines for user-generated content.
133+
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.

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

Lines changed: 24 additions & 26 deletions
Original file line numberDiff line numberDiff line change
@@ -1,6 +1,6 @@
1-
# User actions
1+
# User Actions
22

3-
User actions allow your app to perform certain actions—such as creating posts, comments, or subscribing to subreddits—on behalf of the user, rather than the app account. This enables stronger user engagement while ensuring user control and transparency.
3+
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.
44

55
---
66

@@ -13,17 +13,19 @@ By default, apps make posts or comments using their associated app account. With
1313

1414
---
1515

16-
## Guidelines
16+
Requirements
17+
--------------
1718

1819
To ensure a positive user experience and compliance with Reddit policies:
1920

20-
- **Be transparent:** Inform users and show them the content that will be posted on their behalf.
21-
- **No auto-creation:** Users must opt in to allow the app to post or comment on their behalf. This can only happen on an explicit action.
22-
- **Provide user control:** If you are relying on persistent user opt-in, you must make it clear on how the user can opt-out.
23-
21+
- **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.
22+
- **No automated actions:** Users must explicitly opt-in to the app acting on their behalf. Do not mislead or surprise users.
23+
- **Establish a reporting flow:** Ensure `userGeneratedContent` is correctly set for posts submitted on behalf of the user.
24+
- **Do not gate functionality behind subscribing:** Users should not be made to subscribe to the current subreddit to access any part of your app.
25+
- **Remember the human:** Follow Reddit's safety and compliance guidelines for user-generated content.
2426

2527
:::note
26-
Apps using user actions must follow these guidelines to be approved.
28+
Apps using user actions must follow these requirements to be approved.
2729
:::
2830

2931
---
@@ -59,6 +61,7 @@ After enabling, you can call certain Reddit APIs on behalf of the user by passin
5961
Currently, the following APIs support this option:
6062

6163
- [submitPost()](../../api/redditapi/RedditAPIClient/classes/RedditAPIClient.md#submitpost)
64+
- [submitCustomPost()](../../api/redditapi/RedditAPIClient/classes/RedditAPIClient.md#submitcustompost)
6265
- [submitComment()](../../api/redditapi/RedditAPIClient/classes/RedditAPIClient.md#submitcomment)
6366

6467
If `runAs` is not specified, the API will use `runAs: 'APP'` by default.
@@ -100,8 +103,8 @@ router.post('/internal/post-create', async (_req, res) => {
100103
text: "Hello there! This is a new post from the user's account",
101104
},
102105
subredditName,
103-
title: 'Post Title'
104-
entry: 'default',
106+
title: 'Post Title',
107+
entry: 'default',
105108
});
106109

107110
res.json({ status: 'success', message: `Post created in subreddit ${subredditName}` });
@@ -110,26 +113,21 @@ router.post('/internal/post-create', async (_req, res) => {
110113

111114
---
112115

113-
## Example: Subscribe to subreddit
116+
## Example: Subscribe to current subreddit
114117

115-
The subscribe API does not take a `runAs` parameter; it subscribes as the user by default (if specified in `devvit.json` and approved).
118+
The [subscribeToCurrentSubreddit()](../../api/redditapi/RedditAPIClient/classes/RedditAPIClient.md#subscribetocurrentsubreddit) API does not take a `runAs` parameter; it subscribes as the user by default (if specified in `devvit.json` and approved).
116119

117120
```ts
118121
import { reddit } from '@devvit/web/server';
119122

120-
await reddit.subscribeToCurrentSubreddit();
123+
router.post('/api/subscribe', async (_req, res) => {
124+
try {
125+
await reddit.subscribeToCurrentSubreddit();
126+
res.json({ status: 'success' });
127+
} catch (error) {
128+
res.status(500).json({ status: 'error', message: 'Failed to subscribe' });
129+
}
130+
});
121131
```
122132

123-
:::note
124-
There is no API to check if the user is already subscribed to the subreddit. You may want to store the subscription state in Redis to provide contextually aware UI.
125-
:::
126-
127-
---
128-
129-
## Best practices
130-
131-
- Always inform users before posting or commenting on their behalf.
132-
- Require explicit user opt-in for all user actions.
133-
- Use `userGeneratedContent` for all user-submitted posts.
134-
- Store user consent and subscription state if needed for your app's UX.
135-
- Follow Reddit's safety and compliance guidelines for user-generated content.
133+
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.

0 commit comments

Comments
 (0)