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:
_10create extension if not exists wrappers with schema extensions;
and then enable the Wasm foreign data wrapper:
_10create 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:
- Visit the Slack API Apps page and create a new app from scratch
- Navigate to "OAuth & Permissions" and add the Bot Token Scopes your tables require:
channels:history- read messages in public channelschannels:read- view basic channel informationusers:read- view users in the workspaceusers:read.email- view email addressesfiles:read- view files shared in channelsreactions:read- view emoji reactionsteam:read- view workspace informationusergroups:read- view user groups and their members
- 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.
_10select 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:
_10create 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:
_10create 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
Third-party integrations and docs are managed by Supabase partners.