---
title: "Configuration"
manual: "Laravel-style Notification System - Slack Channel"
version: "1.0"
permalink: "https://docs.typo3.org/permalink/agencelex/notifications-slack:slack-configuration@1.0"
source: "Configuration/Index.rst"
rendered: "2026-10-16T12:40:55+00:00"
---

# Configuration {#slack-configuration}

The extension uses TYPO3 extension configuration under the **actual key**
`notifications_slack`. Configure the values in your TYPO3 installation's
`config/system/additional.php`. The extension repository also contains
`Configuration/ExampleAdditional.php` as a reference; it is not loaded
by TYPO3 automatically.

## Example configuration {#example-configuration}

**config/system/additional.php**

```php
<?php

$GLOBALS['TYPO3_CONF_VARS']['EXTENSIONS']['notifications_slack'] = [
    'botToken' => getenv('SLACK_BOT_TOKEN') ?: '',
    'webhooks' => [
        'monitoring' => getenv('SLACK_WEBHOOK_MONITORING') ?: '',
        'security' => getenv('SLACK_WEBHOOK_SECURITY') ?: '',
    ],
    'apiEndpoint' => 'https://slack.com/api',
    'timeout' => 10,
    'connectTimeout' => 5,
];
```

## Configuration options {#configuration-options}

| Key | Type / default | Purpose |
| --- | --- | --- |
| `botToken` | string | Slack Bot Token, read when an API message is sent but the token is not explicitly specified. |
| `webhooks` | array / empty | Map of safe alias names to complete HTTPS webhook URLs. |
| `apiEndpoint` | string / `https://slack.com/api` | Slack API root; GovSlack: `https://slack-gov.com/api`. |
| `timeout` | integer / 10 | Overall HTTP request timeout (seconds). |
| `connectTimeout` | integer / 5 | HTTP connection timeout (seconds). |

Both timeout values must be integers from **1 to 120**. The endpoint
setting is restricted to the two documented hosts. The client appends
`/chat.postMessage` automatically; do not append it in your configuration.

## Named webhooks {#named-webhooks}

The `webhooks` map may contain multiple destinations. An alias such
as `monitoring` can then be selected in application code:

```php
use Lex\Notifications\Slack\Configuration\SlackRoute;

$route = SlackRoute::webhookNamed('monitoring');
// Equivalent route string: 'webhook:monitoring'
```

Aliases must start with a letter and can contain letters, numbers,
underscores, and hyphens (maximum 64 characters). A named webhook URL
is resolved from the configuration when the transport sends the message.

## Using environment variables {#using-environment-variables}

The configuration can load its secrets from environment variables or
another protected provider. Configure both the HTTP PHP process and the
CLI/queue workers to receive the same secrets.

Do not commit tokens or webhook URLs, disclose configuration dumps, or
make `additional.php` publicly readable. See [Security](https://docs.typo3.org/permalink/agencelex/notifications-slack:slack-security@1.0).

## GovSlack {#govslack}

For GovSlack deployments, configure:

```php
'apiEndpoint' => 'https://slack-gov.com/api',
```

Use the official GovSlack Incoming Webhook host
`https://hooks.slack-gov.com` for webhook routes. The extension validates
approved Slack/GovSlack hosts and requires HTTPS.

> [!NOTE]
> These values are accepted by the source code. Availability of GovSlack
> methods, workspace access, and permission grants depends on your Slack
> organization and application configuration.
