UI Settings¶
Overview¶
UI Settings are special configuration variables that control what interface elements users see in the application. Unlike permissions that control what users can do, UI Settings control what users can see.
These settings are particularly useful for customizing the user experience for different users or groups without changing the underlying functionality or permissions system.
Important: UI Settings are intentionally visible to every member of a group. This transparency ensures all group members have a consistent experience and understand what features are available to them.
How UI Settings Work¶
Naming Convention¶
All UI Settings follow a specific naming pattern: - They start with the prefix UI_ - Followed by a descriptive name in uppercase - Examples: UI_MARKDOWN_SUPPORT, UI_SEND_MESSAGE_TERMS_TEXT
Setting Types¶
UI Settings can be applied at two levels:
- User Settings - Applied to individual users
- Group Settings - Applied to all users within a group
When a user belongs to a group, group settings typically take precedence or are merged with user-specific settings.
Available UI Settings¶
Below is a comprehensive list of available UI Settings. This table will be updated as new settings are added to the system.
| Setting Name | Type | Description | Example Values | Default |
|---|---|---|---|---|
UI_MARKDOWN_SUPPORT | Boolean | Enable/disable markdown-related features and options | 0 (disabled) or 1 (enabled) | 1 |
UI_SEND_MESSAGE_TERMS_TEXT | String | Display terms/conditions text under the send message box | Any text string with optional HTML/links | Empty (not shown) |
Note: Additional UI Settings will be added to this table as they become available.
How to Configure UI Settings¶
Backend Configuration¶
UI Settings are stored in the user or group settings in your backend:
- Navigate to User/Group management
- Add settings with the
UI_prefix - Set the value (typically
0for off,1for on, or text for messages) - Save the settings
How UI Settings Work in the Application¶
Loading Behavior¶
- UI Settings are loaded when the application starts
- For normal chats: Settings are fetched from the standard settings endpoint
- For public chats: Settings are fetched from a dedicated public chat endpoint
- Both user and group settings are retrieved and merged
Not a Permission System¶
Important: UI Settings are not a security or permission system. They only hide UI elements - they don't prevent API access.
If you need to truly restrict what users can do: - Use the proper permissions system - Implement backend validation - Don't rely solely on hiding UI elements
Best Practices¶
1. Use Descriptive Names¶
Choose clear, descriptive names for your UI Settings: - ✅ Good: UI_SHOW_EXPORT_OPTIONS - ❌ Bad: UI_EXP
2. Document Your Settings¶
Keep a record of what each UI Setting does and why it was created.
3. Test Thoroughly¶
Always test UI Settings with actual users to ensure: - The right elements are hidden/shown - The user experience remains intuitive - No important functionality is accidentally hidden
4. Use Groups Efficiently¶
Instead of configuring settings for each user individually: - Create groups for common user types - Apply settings at the group level - Override with user-specific settings only when necessary
5. Don't Overuse¶
Too many hidden features can make the interface inconsistent across users: - Use UI Settings sparingly - Focus on genuinely different use cases - Consider if a toggle in the UI preferences might be better
Examples by Use Case¶
Example 1: Simple User Interface for Non-Technical Users¶
Example 2: Public Bot with Terms¶
{
"UI_SEND_MESSAGE_TERMS_TEXT": "By sending messages to this bot you agree to our Terms and Conditions (link)",
"UI_MARKDOWN_SUPPORT": "0"
}
Example 3: Power User Configuration¶
Security Considerations¶
What UI Settings Are NOT¶
- ❌ Not a security mechanism
- ❌ Not a replacement for permissions
- ❌ Not server-side access control
- ❌ Not protection against API access
What UI Settings ARE¶
- ✅ User experience customization
- ✅ Interface simplification
- ✅ Visual element control
- ✅ Client-side display logic
Important Security Notes¶
Warning: Never rely on UI Settings to prevent unauthorized actions. Users with technical knowledge can bypass hidden UI elements and access APIs directly. Always implement proper backend permissions and validation.
Support¶
If you need help configuring UI Settings: - Contact your system administrator - Check the API documentation - Review the settings endpoint structure - Submit a ticket if issues persist