Skip to main content

Slack configuration

Package: sanvex/slack · Driver id: slack

Auth modes

What to register (Slack)

  1. api.slack.com/appsCreate New App.
  2. OAuth & Permissions → add Bot Token Scopes (chat:write, channels:read, etc.).
  3. Install to Workspace → copy Bot User OAuth Token (xoxb-...).
  4. php artisan sanvex:setup slack --bot-token="xoxb-...".

User token

Use a user token (xoxp-...) with sanvex:setup slack --api-key="xoxp-..." when you need user-context API calls.

OAuth2 (multi-workspace installs)

  1. Same Slack app → OAuth & Permissions.
  2. Add Redirect URLs matching SLACK_REDIRECT_URI.
  3. Copy Client ID and Client Secret from Basic Information.
  4. Implement OAuth in your app; store tokens with SlackKeyBuilder::setOAuthCredentials().

Environment variables

Bot/user tokens belong in sv_accounts via CLI, not in .env.

config/sanvex.php (optional)

Optional — not read by the driver today.

Stored credential keys (sv_accounts)

Runtime token order: bot_tokenapi_keyaccess_token.

CLI

Built-in Sanvex OAuth routes

None.

What the driver reads at runtime

Next: Setup · Resources