> ## Documentation Index
> Fetch the complete documentation index at: https://docs.fliiq.ai/llms.txt
> Use this file to discover all available pages before exploring further.

# Slack

> Send messages and run a real-time listener via Slack

<Note>
  Fliiq integrates with Slack two ways: outbound messaging via the `slack` skill, and a real-time listener in the daemon that responds to DMs and @-mentions.
</Note>

Fliiq gets its own Slack app in your workspace. You message it directly (DM) or mention it in a channel it's been invited to, the same way you'd loop in a teammate.

## Setup

<Steps>
  <Step title="Create a Slack app">
    Go to [api.slack.com/apps](https://api.slack.com/apps) and create a new app. Enable **Socket Mode** under Settings — this lets the daemon receive events over a websocket without exposing a public endpoint (important if it's running behind NAT).
  </Step>

  <Step title="Subscribe to events">
    Under Event Subscriptions, add `app_mention` and `message.im`. This covers channel @-mentions and direct messages.
  </Step>

  <Step title="Generate tokens">
    Generate an app-level token (`xapp-...`) for Socket Mode, and install the app to your workspace to get a bot token (`xoxb-...`).
  </Step>

  <Step title="Add tokens to .env">
    ```bash .env theme={null}
    SLACK_BOT_TOKEN=xoxb-...
    SLACK_APP_TOKEN=xapp-...
    ```
  </Step>

  <Step title="Restart the daemon">
    ```bash theme={null}
    fliiq daemon start
    fliiq daemon status      # Shows "Slack: active" if connected
    ```
  </Step>
</Steps>

<Note>
  **`SLACK_ALLOWED_CHANNELS` is optional**, unlike Telegram's required chat ID allowlist. Workspace membership and channel invitation are already a real access gate. Set `SLACK_ALLOWED_CHANNELS` (comma-separated channel IDs) if you want to further restrict which channels Fliiq responds in.
</Note>

## Outbound: slack skill

Send a message, react, pin, or read history from any Fliiq session:

```
"Send a Slack message to #general saying the deploy finished"
```

## Real-Time Listener

When the daemon starts and `SLACK_BOT_TOKEN` + `SLACK_APP_TOKEN` are set, Fliiq runs a Socket Mode listener that:

1. **Connects over websocket** — no public endpoint or reverse proxy required
2. **Responds only to DMs and @-mentions** — never unaddressed channel chatter. A channel mention fires both `app_mention` and `message` events; `message` is only handled for DMs to avoid double replies
3. **Acks events immediately, then processes** — agent turns can outlast Slack's 3-second retry window, so acking first (plus dedup by event ID) prevents duplicate replies on redelivery
4. **Shows a loading indicator** via `agents.sessions.setStatus` while the agent works
5. **Shares the unified conversation store** with Telegram, email, and SMS — context carries across channels and daemon restarts

```bash theme={null}
fliiq daemon start       # Starts daemon + Slack listener
fliiq daemon status      # Shows "Slack: active" if connected
```

### Using It

Once the daemon is running, DM Fliiq's Slack app or @-mention it in any channel it's in. It responds using the full agent loop — same skills, same memory, same capabilities as the CLI.

## Usage in Jobs

```yaml theme={null}
name: deploy-notifications
trigger:
  type: webhook
prompt: "Post a Slack message to #eng with the deploy summary"
skills:
  - slack
```
