Back
Slack Wrapper

Slack Wrapper

Overview

Slack Wrapper

Slack is a unified work operating system and conversational interface for enterprise apps, data, and agents. Used by millions of teams, it connects people, workflows, and tools in one place, with AI-powered productivity features built natively into the experience.

The Slack Wrapper brings your workspace data into Postgres as queryable foreign tables. Query channels, messages, users, files, and team info with plain SQL and join them against your application data. The wrapper works with Supabase Vault for secure token management and is built on WebAssembly (Wasm) for lightweight, sandboxed execution.

Preparation

Before you get started, make sure the wrappers extension is installed on your database:


_10
create extension if not exists wrappers with schema extensions;

and then enable the Wasm foreign data wrapper:


_10
create foreign data wrapper wasm_wrapper
_10
handler wasm_fdw_handler
_10
validator wasm_fdw_validator;

Create a Slack API token

To authenticate, you'll need a Slack Bot User OAuth Token:

  1. Visit the Slack API Apps page and create a new app from scratch
  2. Navigate to "OAuth & Permissions" and add the Bot Token Scopes your tables require:
    • channels:history - read messages in public channels
    • channels:read - view basic channel information
    • users:read - view users in the workspace
    • users:read.email - view email addresses
    • files:read - view files shared in channels
    • reactions:read - view emoji reactions
    • team:read - view workspace information
    • usergroups:read - view user groups and their members
  3. Install the app to your workspace and copy the Bot User OAuth Token (starts with xoxb-)

Secure your credentials (optional)

By default, Postgres stores FDW credentials inside pg_catalog.pg_foreign_server in plain text. Anyone with access to this table will be able to view these credentials. Wrappers is designed to work with Vault, which provides an additional level of security for storing credentials. We recommend using Vault to store your credentials.


_10
select vault.create_secret(
_10
'xoxb-your-slack-token',
_10
'slack',
_10
'Slack API token for Wrappers'
_10
);

Connecting to Slack

We need to provide Postgres with the credentials to access Slack, and any additional options. We can do this using the create server command:

With Vault:


_10
create server slack_server
_10
foreign data wrapper wasm_wrapper
_10
options (
_10
fdw_package_url 'https://github.com/supabase/wrappers/releases/download/wasm_slack_fdw_v0.2.0/slack_fdw.wasm',
_10
fdw_package_name 'supabase:slack-fdw',
_10
fdw_package_version '0.2.0',
_10
fdw_package_checksum 'bfb0d22ffea2092c049773302c049162a2a57ddc265da59a83116bf29ed40c3a',
_10
api_token_id '<key_ID>',
_10
workspace 'your-workspace' -- optional
_10
);

Without Vault:


_10
create server slack_server
_10
foreign data wrapper wasm_wrapper
_10
options (
_10
fdw_package_url 'https://github.com/supabase/wrappers/releases/download/wasm_slack_fdw_v0.2.0/slack_fdw.wasm',
_10
fdw_package_name 'supabase:slack-fdw',
_10
fdw_package_version '0.2.0',
_10
fdw_package_checksum 'bfb0d22ffea2092c049773302c049162a2a57ddc265da59a83116bf29ed40c3a',
_10
api_token 'xoxb-your-slack-token',
_10
workspace 'your-workspace' -- optional
_10
);

Note: the fdw_package_* options are required and specify the Wasm package metadata. See the Available Versions table above for the full list.

Resources

Details

DeveloperSupabase
DocumentationLearn

Third-party integrations and docs are managed by Supabase partners.

Get started with Slack Wrapper and Supabase.