Skip to content
Merged
Show file tree
Hide file tree
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
23 changes: 23 additions & 0 deletions docs/capabilities/server/settings-and-secrets.mdx
Original file line number Diff line number Diff line change
Expand Up @@ -79,6 +79,29 @@ Define settings in your `devvit.json` file under the `settings` object. Settings
After defining settings in `devvit.json`, you must build your app (`npm run dev`) before you can set secrets via the CLI.
:::

### Help text

Add optional `helpText` to explain a setting. In the installation settings UI, line breaks are preserved. Use `\n` for a new line and `\n\n` for a blank line in JSON:

```json title="devvit.json"
{
"settings": {
"subreddit": {
"welcomeMessage": {
"type": "string",
"label": "Welcome Message",
"defaultValue": "Welcome to the community!",
"helpText": "Shown to new members.\nKeep the message short.\n\nDo not include private information."
}
}
}
}
```

Help text is plain text. Use line breaks to separate instructions, and avoid relying on HTML, Markdown, or repeated spaces for formatting. Omit `helpText` or use an empty string to display no help text.

Individual global and subreddit settings support `helpText`. The example above shows its presentation in installation settings. Help text provides guidance; use `defaultValue` to set an initial value and `validationEndpoint` to validate input.

## Setting types

The following setting types are supported:
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -79,6 +79,29 @@ Define settings in your `devvit.json` file under the `settings` object. Settings
After defining settings in `devvit.json`, you must build your app (`npm run dev`) before you can set secrets via the CLI.
:::

### Help text

Add optional `helpText` to explain a setting. In the installation settings UI, line breaks are preserved. Use `\n` for a new line and `\n\n` for a blank line in JSON:

```json title="devvit.json"
{
"settings": {
"subreddit": {
"welcomeMessage": {
"type": "string",
"label": "Welcome Message",
"defaultValue": "Welcome to the community!",
"helpText": "Shown to new members.\nKeep the message short.\n\nDo not include private information."
}
}
}
}
```

Help text is plain text. Use line breaks to separate instructions, and avoid relying on HTML, Markdown, or repeated spaces for formatting. Omit `helpText` or use an empty string to display no help text.

Individual global and subreddit settings support `helpText`. The example above shows its presentation in installation settings. Help text provides guidance; use `defaultValue` to set an initial value and `validationEndpoint` to validate input.

## Setting types

The following setting types are supported:
Expand Down
Loading