Skip to content

Commit 5fc4d84

Browse files
Dakshclaude
andcommitted
Add legacy documentation snapshot from getstream.io/chat/docs
Extracted from the Stream Chat documentation site, containing all server-side SDK documentation with code examples for this SDK. Co-Authored-By: Claude Opus 4.6 <noreply@anthropic.com>
1 parent 29d4269 commit 5fc4d84

File tree

84 files changed

+14218
-0
lines changed

Some content is hidden

Large Commits have some content hidden by default. Use the searchbox below for content that may be hidden.

84 files changed

+14218
-0
lines changed
Lines changed: 143 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,143 @@
1+
Application level settings control
2+
3+
- The primary storage location
4+
- Production & Development modes
5+
- Authentication behaviour
6+
- Push providers
7+
- Action handlers webhooks
8+
- CDN settings
9+
10+
See also the [User Average Response Time](/chat/docs/java/user_average_response_time/) feature for tracking user responsiveness.
11+
12+
The easiest way to edit this is the dashboard. The docs below show how to change it with the API.
13+
14+
### Edge network & Storage Location
15+
16+
Stream runs an edge network of servers around the world. This ensures that when users connect the chat loads quickly.
17+
We also support offline storage & optimistic UI updates in all SDKs, ensuring a fast user experience.
18+
19+
At the app level you can control the primary region. This is where your data is stored.
20+
Connections always happen at the edge, but data is stored in this primary region.
21+
22+
### Production & Development Mode
23+
24+
Stream apps can be configured to be either in `development mode` or in `production mode`. You can select which mode your app should be in when you create it in the Stream dashboard, and you can easily switch between modes later on.
25+
26+
When your app is in production mode, certain destructive features in the dashboard are disabled. This prevents you from accidentally deleting user data or disabling mission-critical features.
27+
28+
### Authentication Behaviour
29+
30+
Application level settings allow you to configure settings that impact all the channel types in your app. Our backend SDKs make it easy to change the app settings. You can also change most of these using the CLI or the dashboard. Here's an example on changing the disable_auth_checks setting:
31+
32+
```java
33+
// disable auth checks, allows dev token usage
34+
App.update().disableAuthChecks(true).request();
35+
36+
// re-enable auth checks
37+
App.update().disableAuthChecks(false).request();
38+
```
39+
40+
These 2 settings are important. Never run with disable_auth_checks or disable_permission_checks in production.
41+
42+
| NAME | DESCRIPTION | DEFAULT |
43+
| -------------------------- | ----------------------------------------------------------------------------------------------------------------------------------------------- | ------- |
44+
| disable_auth_checks | Disabled authentication. Convenient during testing and allows you to use devTokens on the client side. Should not be used in production. | false |
45+
| disable_permissions_checks | Gives all users full permissions to edit messages, delete them etc. Again not recommended in a production setting, only useful for development. | false |
46+
47+
## Other app settings
48+
49+
### Push
50+
51+
| NAME | DESCRIPTION | DEFAULT |
52+
| --------------- | ----------------------------------------------------------------------------------------- | ------- |
53+
| apn_config | APN config object. See [details](/chat/docs/java#settings-updateapp-request). | |
54+
| firebase_config | Firebase config object. See [details](/chat/docs/java#settings-updateapp-request). | |
55+
| huawei_config | Huawei config object. See [details](/chat/docs/java#settings-updateapp-request). | |
56+
| xiaomi_config | Xiaomi config object. See [details](/chat/docs/java#settings-updateapp-request). | |
57+
| push_config | Global config object. See [details](/chat/docs/java#settings-updateapp-request). | |
58+
59+
### CDN
60+
61+
| NAME | DESCRIPTION | DEFAULT |
62+
| ---------------------- | ------------------------------------------------------------------------------------------ | ----------------- |
63+
| cdn_expiration_seconds | CDN URL expiration time. See [details](/chat/docs/java#settings-updateapp-request). | 1209600 (14 days) |
64+
65+
### Hooks
66+
67+
#### Custom Action Handler and Before Message Send Webhooks
68+
69+
| NAME | DESCRIPTION | DEFAULT |
70+
| ---------------------------- | --------------------------------------------------------------------------------------------------------------- | ------- |
71+
| custom_action_handler_url | This webhook reacts to custom /slash commands and actions on those commands/ | - |
72+
| before_message_send_hook_url | This webhook allows you to modify or moderate message content before sending it to the chat for everyone to see | - |
73+
74+
### Webhooks, SQS, SNS, and pending messages
75+
76+
Webhooks, SQS, SNS, and pending messages async moderation now use the `event_hooks` array configuration. See the [Webhooks](/chat/docs/java/webhooks_overview/) documentation for complete details.
77+
78+
### Moderation & Translation
79+
80+
The following settings allow you to control moderation for your chat:
81+
82+
| NAME | DESCRIPTION | DEFAULT |
83+
| ------------------------ | -------------------------------------------------------------------------------------------------------------------------------------- | ------- |
84+
| image_moderation_labels | Moderation scores returned from the external image moderation API | - |
85+
| image_moderation_enabled | If image moderation AI should be turned on | - |
86+
| enforce_unique_usernames | If Stream should enforce username uniqueness. This prevents people from joining the chat as "elonmusk" while "elonmusk" is presenting. | - |
87+
| auto_translation_enabled | If Stream should automatically translate messages | - |
88+
| async_url_enrich_enabled | If url enrichment should be done async. It will trigger message.updated event | - |
89+
90+
### File Uploads
91+
92+
You can set restrictions on file uploads by including a `file_upload_config` object. You can set either an inclusive list using `allowed_file_extensions` and `allowed_mime_types` or an exclusive list using `blocked_file_extensions` and `blocked_mime_types` .
93+
94+
The `file_upload_config` object accepts the following fields:
95+
96+
| NAME | DESCRIPTION | Example | Default |
97+
| ----------------------- | ----------------------------------------------------------------------------------------------------------------------------------------------------------------------------------- | --------------------------------------- | ------- |
98+
| allowed_file_extensions | An array of file types that the user can submit. Files with an extension that does not match the values in this array will be rejected. | [".tar", ".png", ".jpg"] | - |
99+
| blocked_file_extensions | An array of file types that the user can submit. Files with an extension that does not match the values in this array will be rejected. | [".tar", ".png", ".jpg"] | - |
100+
| allowed_mime_types | An array of file MIME types that the user can submit. Files with an MIME type that does not match the values in this array will be rejected. Must follow the type/ subtype pattern. | ["text/css", "text/plain", "image/png"] | - |
101+
| blocked_mime_types | An array of file types that the user can submit. Files with an MIME type that does not match the values in this array will be rejected. Must follow the type/ subtype pattern. | ["text/css", "text/plain", "image/png"] | - |
102+
| size_limit | A number that represents the maximum accepted file size in bytes. In case its 0 the default maximum is used. | 10485760 | 0 |
103+
104+
For example, the following code shows how to block all attempts to upload any files that are not .csv:
105+
106+
```java
107+
var cfg = App.FileUploadConfigRequestObject
108+
.builder()
109+
.allowedFileExtensions(List.of(".csv"))
110+
.allowedMimeTypes("text/csv")
111+
.build();
112+
113+
App.update().fileUploadConfig(cfg).request();
114+
```
115+
116+
### Image Uploads
117+
118+
You can set restrictions on file uploads by including an `image_upload_config` object. You can set either an inclusive list using `allowed_file_extensions` and `allowed_mime_types` or an exclusive list using `blocked_file_extensions` and `blocked_mime_types` .
119+
120+
The `image_upload_config` object accepts the following fields:
121+
122+
| NAME | DESCRIPTION | Example | Default |
123+
| ----------------------- | ----------------------------------------------------------------------------------------------------------------------------------------------------------------------------------- | -------------------------------------------- | ------- |
124+
| allowed_file_extensions | An array of file types that the user can submit. Files with an extension that does not match the values in this array will be rejected. | [".gif", ".png", ".jpg"] | - |
125+
| blocked_file_extensions | An array of file types that the user can submit. Files with an extension that does not match the values in this array will be rejected. | [".tar", ".tiff", ".jpg"] | - |
126+
| allowed_mime_types | An array of file MIME types that the user can submit. Files with an MIME type that does not match the values in this array will be rejected. Must follow the type/ subtype pattern. | ["image/jpeg", "image/svg+xml", "image/png"] | - |
127+
| blocked_mime_types | An array of file types that the user can submit. Files with an MIME type that does not match the values in this array will be rejected. Must follow the type/ subtype pattern. | ["text/css", "text/plain", "image/tiff"] | - |
128+
| size_limit | A number that represents the maximum accepted file size in bytes. In case its 0 the default maximum is used. | 10485760 | 0 |
129+
130+
For example, the following code shows how to block all attempts to upload any files that are not gif, jpeg, or png files:
131+
132+
```java
133+
var cfg = App.FileUploadConfigRequestObject
134+
.builder()
135+
.allowedFileExtensions(List.of(".gif", ".jpeg", ".png"))
136+
.allowedMimeTypes("image/gif", "image/jpeg", "image/png")
137+
.build();
138+
139+
App.update().imageUploadConfig(cfg).request();
140+
```
141+
142+
> [!NOTE]
143+
> Stream allowed types for images are: `image/bmp` , `image/gif` , `image/jpeg` , `image/png` , `image/webp` , `image/heic` , `image/heic-sequence` , `image/heif` , `image/heif-sequence` , `image/svg+xml` . Applications can set a more restrictive list, but would not be allowed to set a less restrictive list.
Lines changed: 72 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,72 @@
1+
In most cases, you define your channel settings and features at the [Channel Type](/chat/docs/java/channel_features/) level and then have these inherited by all the channels of the same type. For instance you can configure [Livestream](/chat/docs/java/channel_features/) channels without typing events and enable reactions and replies for all [Messaging](/chat/docs/java/channel_features/) type channels.
2+
3+
This approach does not work well if your application has many different combination of settings for channels and that is when channel-level settings can be useful.
4+
5+
Channel-level settings allow you to override one or more settings for a channel without changing other channels of the same type. A few important things to mention about channel-level settings:
6+
7+
1. Settings that are not overridden at channel level will use the current setting from the channel type
8+
9+
2. Changing channel-level settings can only be done server-side
10+
11+
### List of settings that can be overridden
12+
13+
Not all channel type settings can be configured at the channel level, here is the complete list of settings that can be overridden.
14+
15+
- **typing_events** : Controls if typing indicators are shown.
16+
17+
- **reactions** : Controls if users are allowed to add reactions to messages.
18+
19+
- **replies** : Enables message threads and replies.
20+
21+
- **uploads** : Allows image and file uploads within messages.
22+
23+
- **url_enrichment** : When enabled, messages containing URLs will be enriched automatically with image and text related to the message.
24+
25+
- **commands** : Enable a set of commands for this channel.
26+
27+
- **max_message_length** : The max message length.
28+
29+
- **blocklist** : A list of words you can define to moderate chat messages. More information can be found [here](/moderation/docs/engines/blocklists-and-regex-filters/).
30+
31+
- **blocklist_behavior** : set as  `block`  or  `flag` to determine what happens to a message containing blocked words.
32+
33+
- **grants** : Allows to modify channel-type permission grants for particular channel. More information can be found [here](/chat/docs/java/chat_permission_policies/)
34+
35+
- **user_message_reminders** : Allow users to set reminders for messages. More information can be found [here](/chat/docs/java/message_reminders/)
36+
37+
- **shared_locations** : Allow users to share their current location. More information can be found [here](/chat/docs/java/location_sharing/)
38+
39+
- **count_messages** : Enables counting messages on new channels.
40+
41+
### Examples
42+
43+
#### Use a different blocklist
44+
45+
```java
46+
var configOverrides = new HashMap<String, String>();
47+
configOverrides.put("blocklist", "medical_blocklist");
48+
configOverrides.put("blocklist_behavior", "block");
49+
50+
Channel.partialUpdate("<channel-type>", "<channel-id>")
51+
.setValue("config_overrides", configOverrides)
52+
.request();
53+
```
54+
55+
#### Disables replies
56+
57+
```java
58+
var configOverrides = new HashMap<String, Boolean>();
59+
configOverrides.put("replies", false);
60+
61+
Channel.partialUpdate("<channel-type>", "<channel-id>")
62+
.setValue("config_overrides", configOverrides)
63+
.request();
64+
```
65+
66+
#### Remove overrides and go back to default settings
67+
68+
```java
69+
Channel.partialUpdate("<channel-type>", "<channel-id>")
70+
.setValue("config_overrides", new HashMap<String, String>())
71+
.request();
72+
```

0 commit comments

Comments
 (0)