slack

A comprehensive Go client for the Slack Web API, RTM, Events API, and Socket Mode.

SDK
Go
vv0.29.0
4,958stars
BSD-2-Clause

Repository Health

Pre-computed score based on development activity, maintenance, community, maturity, and trend momentum.How we score it →
91/100Excellent
Development Activity88
Maintenance92
Community84
Maturity60
Momentum40

Technical Analysis

AI-assessed by reading the actual repository — architecture, code quality, innovation, and documentation.How we score it →
73/100Good
Architecture78
Code Quality82
Innovation58
Learning Curve75

slack-go/slack is a community-maintained Go library that wraps nearly all of Slack’s api.slack.com REST surface, plus the Real-Time Messaging (RTM) protocol over websocket and Socket Mode for fully managed, firewall-friendly event delivery. A single slack.Client, constructed with slack.New(token), exposes typed methods for messaging, channels, users, files, reactions, admin APIs, and more, each returning strongly typed response structs instead of raw JSON.

Beyond the core API client, the module ships companion packages for the pieces a real Slack app needs: slackevents for parsing and routing the Events API payload, socketmode for a managed Socket Mode connection with an optional handler-based event router, and slacktest for spinning up a fake Slack server in unit tests. An extensive Block Kit builder API (block_*.go files) covers sections, headers, images, rich text, tables, and interactive elements for building modern Slack UIs, and opt-in HTTP retry handlers add resilience against rate limits and transient network failures.

What You Get

  • A typed Client covering most of the Slack Web API — messaging, channels/conversations, users, files, reactions, pins, bookmarks, admin, and audit endpoints
  • Full Block Kit builders for sections, headers, images, rich text, tables, data visualization blocks, and interactive elements
  • Managed Socket Mode client and an event-handler router (socketmode.SocketmodeHandler) for routing incoming events without hand-rolled switch statements
  • RTM (NewRTM + ManageConnection) and legacy websocket-based real-time messaging support
  • slackevents subpackage for parsing and validating Events API callbacks
  • slacktest subpackage providing an in-process fake Slack server for writing unit tests without hitting the real API
  • Opt-in HTTP retry handling (OptionRetry, OptionRetryConfig) for 429 rate limits, connection errors, and optional 5xx retries
  • OAuth flow helpers, interactive message/dialog support, and manifest (app configuration) APIs

Common Use Cases

  • Building a Slack bot that posts and updates messages, reacts to mentions, and responds to slash commands
  • Implementing a Socket Mode app that receives events over a persistent websocket without exposing a public HTTP endpoint
  • Building rich interactive Slack UIs with Block Kit — modals, home tabs, and message attachments with buttons and menus
  • Writing an internal ops tool that manages channels, users, or workspace admin settings via the Slack Web API
  • Building a webhook receiver that parses and verifies Slack Events API payloads with slackevents
  • Unit testing Slack integrations against slacktest’s fake server instead of live Slack workspaces

Under The Hood

Architecture A single slack package at the repo root holds roughly 190 Go files organized by API domain — chat.go, users.go, channels.go, admin*.go, and dozens of block_*.go files for Block Kit. Every API call funnels through the central Client struct defined in slack.go, which centralizes cross-cutting concerns like the auth token, debug logging, warning callbacks, and retry configuration, so a change to the core request path affects every method uniformly. Real-time transports (rtm.go, websocket.go, websocket_managed_conn.go) build on that same Client but layer their own managed-connection and reconnect state. Companion capabilities live in separate Go packages under subdirectories — socketmode/, slackevents/, slacktest/, slackutilsx/, internal/ — rather than folders within the main package, letting consumers import just what they need (e.g. Events API parsing without pulling in the RTM/websocket dependency chain).

Tech Stack A Go module targeting Go 1.26 with a deliberately minimal dependency footprint: gorilla/websocket for the RTM and legacy websocket transports, stretchr/testify for test assertions, and go-test/deep for structural diffing in tests. There is no web framework, ORM, or database — this is a pure API-client library built on net/http, wrapped by an internal retry.go/backoff module that implements configurable, pluggable retry policies for rate limits, connection errors, and optional 5xx responses.

Code Quality Test coverage is extensive — roughly 84 top-level _test.go files closely mirroring the production files, plus further tests inside socketmode/ and slacktest/, all using testify for assertions. Errors are explicit sentinel values defined through an internal errorsx.String type in errors.go rather than being swallowed, and retry.go shows careful handling of transient failures with a pluggable handler chain. CONTRIBUTING.md documents a make pr-prep step that runs formatting, linting, and the full test suite before a PR is opened, and CI runs on every push via .github/workflows/test.yml.

API Design The public API favors ergonomics: slack.New(token) returns a ready-to-use client, most calls are one-liners returning strongly typed response structs instead of raw JSON, and a consistent functional-options pattern (Option, ParamOption) configures both the client and individual calls. Block Kit builders mirror Slack’s nested block JSON with typed Go constructors, cutting the boilerplate of hand-writing block payloads, and socketmode.SocketmodeHandler offers a registerable event router in place of a manual type-switch. The design isn’t conceptually novel — it’s a conventional REST/websocket SDK wrapper — but its breadth of coverage and the Socket Mode handler router are genuine ergonomic wins over calling the Slack HTTP API directly.

Used by 11 apps in this directory

Go
73%
Other

Convoy

Developer Tools · Devops

2,862

Convoy is an open-source, cloud-native webhooks gateway that ingests events over HTTP or straight from Kafka, SQS, Google Pub/Sub, and RabbitMQ, then reliably delivers them to subscriber endpoints with signed payloads, automatic retries, circuit breaking, and JavaScript-based transformations.

View details
89
Repo Health
81
Technical
66
Dependency
Built with
Go73%
TypeScript13%
HTML12%
Updated yesterday
Go
63%
Apache 2.0

Coroot

Analytics · Monitoring

7,895

eBPF-powered observability with AI root cause analysis — zero code changes required, full-stack visibility out of the box.

View details
88
Repo Health
80
Technical
65
Dependency
Built with
Go63%
Vue35%
Updated 3 days ago
Go
75%
MIT

Digger

Devops · Automation · Developer Tools

5,033

Run Terraform and OpenTofu natively inside your existing CI pipeline — no separate runners, no third-party secrets, no extra compute costs.

View details
71
Repo Health
73
Technical
67
Dependency
Built with
Go75%
TypeScript15%
Updated 2 weeks ago
Go
84%
MIT

Hatchet

AI Development · Developer Tools · Automation

7,812

A Postgres-backed orchestration engine for background tasks, AI agents, and durable workflows that replaces Redis queues and multi-datastore durable execution platforms with a single self-hostable service.

View details
88
Repo Health
83
Technical
68
Dependency
Built with
Go84%
PLpgSQL11%
Updated today
TypeScript
71%
Other

highlight.io

Developer Tools · Analytics · Monitoring

9,373

Open-source full-stack monitoring that unifies session replay, error tracking, logging, and distributed tracing so you can stop context-switching between tools.

View details
70
Repo Health
78
Technical
65
Dependency
Built with
TypeScript71%
Go16%
Updated 1 weeks ago
Go
58%
MIT

hoop

Security · Monitoring

805

A wire-protocol gateway that enforces data masking, command blocking, approval workflows, and full session recording for engineers and AI agents accessing production infrastructure.

View details
85
Repo Health
80
Technical
65
Dependency
Built with
Go58%
Clojure19%
JavaScript14%
Updated 2 days ago
Go
97%
Apache 2.0

infracost

Devops · Developer Tools

12,499

Infracost shows cloud cost estimates for Terraform, CloudFormation, and AWS CDK before you deploy — in your terminal, editor, AI coding agent, and pull requests.

View details
79
Repo Health
78
Technical
68
Dependency
Built with
Go97%
Updated 6 days ago
Go
56%
Other

Multica

AI Assistants · AI Development

48,263

Turn coding agents into real teammates — assign issues, track progress, and compound reusable skills across a vendor-neutral, self-hosted platform.

View details
86
Repo Health
83
Technical
70
Dependency
Built with
Go56%
TypeScript39%
Updated today
Go
91%
Apache 2.0

Ory Kratos

Authentication

13,853

API-first identity and user management that handles login, registration, MFA, and recovery so your application never has to.

View details
84
Repo Health
78
Technical
67
Dependency
Built with
Go91%
Updated 1 months ago

Join founders buildingwith open source

Opinionated takes, migration guides, cost-saving tips, and insights from the open source ecosystem.

Subscribe on Substack
Join 750+ subscribers

Search