# Configuration

> Look up package defaults and the settings your host app can override.

[Web documentation](https://threads.teamkrope.com/docs/configuration/) · Inner Threads v1.3.0

Publish the configuration and edit `config/inner-threads.php`.

```bash
php artisan vendor:publish --tag=inner-threads-config
```

Only override settings the host needs. Package defaults fill in the remaining keys. Rebuild Laravel's config and route caches after changing routing in a cached deployment.

## Routing and identity

| Key | Default | Purpose |
| --- | --- | --- |
| `enabled` | `true` | Enable package routes and widget |
| `routing.prefix` | `inner-threads/api/v1` | API URL prefix |
| `routing.middleware` | `['web', 'auth']` | Host session, CSRF and auth middleware |
| `routing.read_throttle` | `throttle:180,1,inner-threads-read` | Read request limit |
| `routing.write_throttle` | `throttle:60,1,inner-threads-write` | Write request limit |
| `routing.send_throttle` | `throttle:30,1,inner-threads-send` | Send limit |
| `routing.link_preview_throttle` | `throttle:18,1,inner-threads-link-preview` | Draft link preview lookup limit |
| `directory` | `EloquentDirectory::class` | Contact and workspace adapter |
| `users.model` | `null` | Use the authenticated Eloquent model |
| `users.id_column` | `null` | Use the model key column |
| `users.name_column` | `name` | Display name field |
| `users.avatar_column` | `null` | Optional avatar field |
| `users.active_column` | `null` | Optional field for filtering contacts |
| `users.active_value` | `true` | Value required in that field |
| `users.workspace` | `default` | Default static workspace key |

## Contact visibility

| Key | Default | Purpose |
| --- | --- | --- |
| `visibility.enabled` | `false` | Apply the host's role rules for contact discovery, direct chats and group invitations |
| `visibility.role_resolver` | `null` | Host class implementing `ContactRoleResolver` |
| `visibility.rules` | `[]` | Allowed target roles by viewer role |
| `visibility.shared_contacts` | `[]` | Optional eligible account IDs by workspace |

See [Contact visibility](https://threads.teamkrope.com/docs/contact-visibility/) for a role resolver, a complete set of visibility rules, and shared support setup. For company and tenant scoping, configure [Users and workspaces](https://threads.teamkrope.com/docs/users-workspaces/) first.

## Features

Set `INNER_THREADS_ENABLED=false` to disable the package routes. A published `enabled` override takes precedence over the environment setting. Clear cached configuration and routes after changing it.

The `features.*` switches default to `true` except `message_search`, which defaults to `false`.

| Key | Control |
| --- | --- |
| `groups` | Group creation and settings |
| `search` | Inbox search for contactable users |
| `message_search` | Include recent accessible messages and group names in inbox search (off by default) |
| `attachments` | File upload and download |
| `link_previews` | Fetch and display public website previews |
| `voice_messages` | Record and send voice messages |
| `replies` | Quoted replies |
| `mentions` | Group mentions |
| `reactions` | Emoji reactions |
| `editing` | Editing messages |
| `delete_for_me` | Hide a message for the current user |
| `delete_for_all` | Delete owned messages for everyone |
| `receipts` | Visible read and delivered receipts |
| `browser_notifications` | Show the header bell for browser notification opt-in |

## Groups

| Key | Default | Purpose |
| --- | --- | --- |
| `groups.max_members` | `50` | Maximum group size |
| `groups.history_for_new_members` | `false` | Include history from before joining |
| `groups.allow_member_leave` | `true` | Allow members to leave |

## Messages and search

| Key | Default | Purpose |
| --- | --- | --- |
| `messages.max_length` | `4000` | Maximum text length |
| `messages.edit_window_minutes` | `30` | Edit window. `null` removes the time limit. |
| `messages.delete_window_minutes` | `3600` | Maximum age for deleting your own message for everyone. Set fewer minutes for a shorter window. The maximum is 60 hours. |
| `messages.page_size` | `40` | Thread page size |
| `messages.inbox_page_size` | `24` | Inbox page size |
| `messages.reactions` | 👍 ❤️ 😂 😮 😢 🎉 | Supported reactions |
| `search.results_limit` | `20` | Results per search category |
| `search.message_scan_limit` | `300` | Recent accessible messages considered for search |

## Attachments

| Key | Default | Purpose |
| --- | --- | --- |
| `attachments.disk` | `local` | Private Laravel storage disk |
| `attachments.directory` | `inner-threads` | Base storage directory |
| `attachments.max_files` | `50` | Files per outgoing message |
| `attachments.max_kilobytes` | `2097152` | Size cap per file, 2 GiB by default |
| `attachments.allowed_mime_types` | `[]` | Accepts all file types by default. Add detected MIME types to restrict uploads. |
| `attachments.image_preview` | `true` | Allow inline previews for supported images |
| `attachments.video_preview` | `true` | Allow inline playback for MP4 and WebM |

Override either limit in the host app's `config/inner-threads.php`. PHP's file count and per-file limits must cover your app settings. The request size allowed by PHP and any web server or proxy must cover the combined batch plus multipart overhead.

## Voice messages

Set `features.voice_messages` to `false` to disable new recordings. Conversation members can still play existing voice messages.

| Key | Default | Purpose |
| --- | --- | --- |
| `voice.max_seconds` | `120` | Maximum recording time in the widget, from 1 to 600 seconds |

Voice recordings use the private attachment disk and `attachments.max_kilobytes` limit. They support WebM, MP4, and Ogg independently of the general file MIME allowlist.

## Encryption

| Key | Environment | Default |
| --- | --- | --- |
| `encryption.enabled` | `INNER_THREADS_ENCRYPTION_ENABLED` | `true` |
| `encryption.key` | `INNER_THREADS_ENCRYPTION_KEY` | Uses `APP_KEY` |
| `encryption.previous_keys` | `INNER_THREADS_ENCRYPTION_PREVIOUS_KEYS` | Empty list |

## Realtime

| Key | Default | Purpose |
| --- | --- | --- |
| `realtime.enabled` | `false` | Use `INNER_THREADS_REALTIME_ENABLED` to enable broadcasting |
| `realtime.namespace` | Derived from `APP_KEY` | Override with `INNER_THREADS_REALTIME_NAMESPACE` |
| `realtime.guards` | `[]` | Optional guards for broadcast authorization |
| `realtime.poll_interval_ms` | `12000` | Fallback poll interval |
| `realtime.heartbeat_interval_ms` | `45000` | Poll interval during a healthy subscription |

## Widget

| Key | Default |
| --- | --- |
| `widget.serve_assets` | `true` (serve bundled assets through Laravel) |
| `widget.asset_path` | `vendor/inner-threads` |
| `widget.mode` | `floating` |
| `widget.view` | `compact` (or `expanded`) |
| `widget.side` | `right` |
| `widget.theme` | `light` |
| `widget.dates.relative` | `true` |
| `widget.dates.weekday_days` | `6` (set `0` to skip weekday names) |
| `widget.dates.format` | `null` (locale’s medium date style, or an Intl date options map) |
| `widget.dates.time_zone` | `null` (viewer’s device, or an IANA time zone such as `Asia/Karachi`) |
| `widget.accent` | `#29292e` |
| `widget.brand` | `Inner Threads` |
| `widget.show_watermark` | `true` (show the linked logo in the inbox header) |
