slack-ruby/slack-ruby-client
66.5
Adequate · 20 September 2026
1.1k
lines of production code
Ruby
primary language
1
measurement over time
What this system is
This system is a Ruby library and command-line tool for interacting with the Slack Web and Admin APIs. It provides a structured client for making API requests, handling cursor-based pagination, and managing authentication via OAuth v2 and API tokens. The library also includes utilities for formatting messages, verifying event signatures, and resolving user or channel IDs from names.
How it got here
2015 — Web API client and CLI infrastructure
20 changes.
The project introduced a comprehensive Slack Web API client built on Faraday, featuring auto-generated endpoints from the upstream specification and robust error handling. This release also added a new command-line interface for administrative tasks and established global configuration and logging infrastructure. Supporting changes included migrating CI to GitHub Actions, removing the ActiveSupport dependency, and expanding test coverage for the new components.
2016–2017 — API client generation and pagination support
10 changes.
This period focused on enhancing the Slack Web API client by introducing automated code generation from API references and implementing robust cursor-based pagination with rate-limit handling. Significant improvements were also made to message formatting utilities and user/conversation ID resolution, accompanied by comprehensive test coverage and refactored error handling for better reliability.
2019–2025 — Slack API v2 and security enhancements
8 changes.
This period focused on modernizing the Slack client by implementing OAuth v2 support and the sequential file upload API (files\_upload\_v2). Significant effort was also dedicated to strengthening security through robust signature verification for Slack Events and utility functions, accompanied by comprehensive test coverage for these new features and existing endpoints.
Features
Add OAuth v2 user token example
A new Ruby-based example in the \examples/oauth\_v2\ directory demonstrates how to obtain a user OAuth token via the Slack OAuth v2 flow. The sample includes a local web server that handles the callback, exchanges the authorization code for access tokens, and displays the resulting bot and user access tokens, scopes, and user ID. It also provides a \.env.example\ file and README instructions for configuring client credentials, redirect URIs, and required scopes.
_examples/oauth\v2 · high confidence
Add message formatting utilities and structured message object
Users can now easily format Slack messages using the new \Slack::Messages::Formatting\ module, which provides methods to escape/unescape text, convert basic Markdown to Slack's format, and generate links for users, channels, groups, and URLs. Additionally, the \Slack::Messages::Message\ class is introduced as a Hashie::Mash to provide structured access to message data and improved logging.
lib/slack/messages · high confidence
Added Slack command-line client
A new executable script at bin/slack provides a command-line interface for interacting with Slack. It leverages the GLI library for argument parsing and the slack\_ruby\_client gem for API communication. Users can authenticate via the SLACK\_API\_TOKEN environment variable or the --slack-api-token flag, enable debug logging with the -d switch, and use offline VCR cassettes for testing via the --vcr-cassette-name option.
bin · high confidence
Added Slack web client example
A new example file (hi.rb) has been added to the examples/hi\_web directory demonstrating how to configure and use the slack-ruby-client library. This example shows how to set up the client with an API token from the environment, authenticate via auth\_test, and post a message to a Slack channel.
_examples/hi\web · high confidence
Added user and conversation ID resolution and user search capabilities
This change introduces new API mixins to resolve Slack IDs from names and to search for users. The \users\_id\ and \conversations\_id\ methods allow users to look up the ID for a specific user or channel by name, handling pagination and error cases (such as \user\_not\_found\ or \channel\_not\_found\) via a shared \Ids\ mixin. Additionally, a new \users\_search\ method is added, which uses the optional \Picky\ library to build an in-memory index of team members and perform fuzzy searches across name, first name, last name, real name, and email fields. These features enable more flexible interaction with Slack entities without requiring prior knowledge of their internal IDs.
lib/slack/web/api/mixins · high confidence
Auto-generated Web API client, CLI, and test templates
The library now includes a set of ERB templates that auto-generate the Slack Web API client methods, command-line interface commands, error classes, and corresponding RSpec tests from API specification data. This automation ensures that generated code handles required arguments, mutually exclusive parameter groups, JSON encoding, cursor-based pagination, and automatic ID resolution for channels and users, while also logging warnings for deprecated and undocumented endpoints.
lib/slack/web/api/templates · high confidence
Automated Slack Web API client generation
The library now includes Rake tasks to automatically generate the Web API client code, endpoints, specs, and CLI commands from the local Slack API reference submodule. Running the update task fetches the latest API definitions, validates them against JSON schemas, and regenerates the corresponding Ruby files, ensuring the client stays in sync with Slack's current API surface.
lib/tasks · high confidence
Expanded CLI coverage for Slack Enterprise Admin API methods
The command-line client now exposes a broad set of new administrative capabilities through auto-generated commands in the \bin/commands\ directory. This update adds CLI wrappers for Enterprise Admin API endpoints, including \admin\_analytics\ (for retrieving data and message activity metrics), \admin\_apps\ (for approving, restricting, and uninstalling apps), \admin\_apps\_mcp\_servers\ (for managing Model Context Protocol server permissions), \admin\_audit\_anomaly\_allow\ (for configuring IP/ASN allowlists), \admin\_auth\_policy\ (for assigning users to authentication policies), \admin\_barriers\ (for creating and managing information barriers), \admin\_conversations\ (for bulk channel operations, Salesforce integration, and retention policies), \admin\_conversations\_ekm\ (for managing disconnected channel key revocation), \admin\_conversations\_restrictAccess\ (for IDP group allowlists), \admin\_emoji\ (for adding, aliasing, and removing emojis), \admin\_functions\ (for listing and setting function visibility), and \admin\_inviteRequests\ (for approving or denying workspace invite requests).
bin/commands · high confidence
Introduce Slack Web API client with configurable connection settings
Adds the \Slack::Web::Client\ class and its associated configuration module (\Slack::Web::Config\), enabling users to interact with the Slack Web API. The client supports global configuration via \Slack::Web::Client.configure\ or per-instance options, allowing customization of connection parameters such as proxy, user agent, SSL CA paths, timeouts, and the Faraday adapter. It also exposes settings for pagination sizes, retry limits, and logging, providing a structured way to manage HTTP requests to the Slack API.
lib/slack/web · high confidence
Introduces global configuration and logging infrastructure
The library now provides a centralized way to manage settings and output via \Slack.configure\, which allows users to set a global \token\ and \logger\. A new \Slack::Config\ module handles these attributes and includes a \reset\ method to clear them, while a new \Slack::Logger\ class offers a default logger instance. This change also bumps the version to 3.2.1, reflecting the addition of these core infrastructure components.
lib/slack · high confidence
Introduces sequential file upload method (files\_upload\_v2)
Adds a new \files\_upload\_v2\ helper that implements Slack's sequential file upload flow, replacing the legacy \files.upload\ method. This change allows users to upload multiple files in a single request, specify files via an array of objects, and target specific channels using \channel\, \channel\_id\, or \channels\ parameters. It also supports rich text formatting via the \blocks\ parameter and threaded replies via \thread\_ts\.
lib/slack/web/api/helpers · high confidence
New admin API endpoints for analytics, apps, audit, auth, barriers, and conversations
The Web API client now includes auto-generated endpoint modules for several new Slack Admin API areas. This adds methods to retrieve analytics data and message activity metadata, manage app installation approvals/restrictions/uninstalls and look up app configurations, handle IP/ASN allow-lists for anomaly detection, assign and remove entities from authentication policies, create and manage information barriers, and perform bulk operations on channels (archive, delete, move, set properties, exclude from Slack AI) alongside standard channel creation and conversion. These changes expand the library's coverage of enterprise administration capabilities.
lib/slack/web/api/endpoints · high confidence
New example script for creating Slack tickets with attachments
Added a new Ruby example script (examples/new\_ticket/new\_ticket.rb) that demonstrates how to use the slack-ruby-client library to post a message to a Slack channel. The script configures the client using an environment variable for the API token and sends a message to \#general containing a formatted attachment with ticket details, such as title, text, and color, illustrating the usage of the chat\_postMessage API with attachment objects.
_examples/new\ticket · high confidence
New files\_upload\_v2 example demonstrating multi-file uploads
A new example in the \examples/files\_upload\_v2\ directory demonstrates the \files\_upload\_v2\ API method, including the capability to upload multiple files in a single request. The sample code shows how to upload single files by content, target specific channels by name or ID, and upload multiple files simultaneously to a channel.
_examples/files\_upload\v2 · high confidence
Slack Events signature verification and configuration
Added a new configuration module and request verification class for Slack Events. Users can now configure a global signing secret and signature expiration time, or specify them per-request. The new Request class validates incoming Slack event payloads by verifying the HMAC-SHA256 signature and checking timestamp expiration, raising specific errors for missing secrets, invalid signatures, or expired requests.
lib/slack/events · high confidence
Support for cursor-based pagination with rate-limit handling
The Slack web client now supports cursor-based pagination, allowing users to iterate through paginated API responses seamlessly. This new cursor pagination implementation respects rate limits by automatically sleeping when a TooManyRequestsError is encountered, and it also supports a configurable sleep interval between requests to manage API usage more effectively.
lib/slack/web/pagination · high confidence
Removals
Removed unnecessary patch directory
The \lib/slack/web/api/patches\ directory has been removed as it contained no functional code, only a \.gitkeep\ file. This cleanup eliminates an empty directory structure that was no longer needed for API patching logic.
lib/slack/web/api/patches · high confidence
Behavioural changes
Improved error handling and security for Slack Web API responses
The Slack Web API client now provides more granular error handling and improved security. When a 429 rate-limit response is received, a dedicated TooManyRequestsError is raised. For other API errors, the client now concatenates multiple error messages into a single string and raises specific error classes based on the error code, falling back to a generic SlackError if no specific class is defined. Server errors (5xx) and network issues like timeouts or connection failures now raise UnavailableError and TimeoutError respectively. Additionally, the Authorization header is automatically redacted from any error response objects to prevent accidental exposure of credentials.
lib/slack/web/faraday/response · high confidence
Refactored HTTP client to use Faraday with configurable timeouts and proxy support
The Slack Web API client now uses Faraday for HTTP connections, introducing support for configurable request timeouts, open timeouts, and proxy settings. This change also updates the user-agent header format and ensures proper handling of SSL certificates via ca\_path and ca\_file options.
lib/slack/web/faraday · high confidence
Refactored Web API error classes and added response metadata access
The error handling classes in the Slack Web API have been restructured to inherit directly from Faraday errors and are now namespaced under Slack::Web::Api::Errors. A new SlackError class exposes a response\_metadata accessor, allowing users to inspect metadata from the API response body. Additionally, specific error types like ServerError, ParsingError, HttpRequestError, TimeoutError, UnavailableError, and TooManyRequestsError have been defined with clearer inheritance hierarchies and access to response details.
lib/slack/web/api/errors · high confidence
Replace ActiveSupport with custom security utilities
The library no longer depends on ActiveSupport for security functions. A new \Slack::Utils::Security\ module provides \secure\_compare\ and \fixed\_length\_secure\_compare\ methods, copied from ActiveSupport, to handle constant-time string comparisons for signature verification. This change removes the ActiveSupport dependency while maintaining secure comparison capabilities for verifying incoming event requests.
lib · high confidence
Repository maintenance and CI migration
The project has migrated its continuous integration from Travis CI to GitHub Actions, removing the legacy .travis.yml configuration. RuboCop has been upgraded to version 1.26.1 with a comprehensive reconfiguration of style and performance cops, and the Dangerfile has been updated to use the danger-pr-comment workflow. Additionally, a SECURITY.md policy has been added to direct vulnerability reports to Tidelift, and the .gitignore has been updated to exclude new coverage and IDE artifacts.
(repo-wide) · high confidence
Slack Web API client updated to latest reference specification
The Slack Web API client has been regenerated from the upstream slack-api-ref repository (commit d980b88), introducing a comprehensive set of new API endpoints and error classes. This update adds support for modern Slack features including Admin Workflows, Canvases, Assistant search, Functions, and OAuth v2 user endpoints, while also introducing granular error handling for new API responses. Users will gain access to these new capabilities and more specific error feedback when interacting with the Slack platform.
lib/slack/web/api · high confidence
Test coverage
Added test coverage for Faraday request authorization; Added test coverage for conversations and users ID resolution mixins; Added test coverage for custom Slack API endpoints; Added test support files for VCR configuration and token management; Added tests for Slack Events configuration and request verification; Added tests for Slack Web API error handling and JSON encoding; Added tests for Slack Web API error handling and security; Added tests for Slack configuration and CLI client; Added tests for Slack message formatting utilities; Added tests for Slack signature verification utilities; Added tests for Slack::Web::Client configuration and connection setup; Added tests for SlackError response and response\_metadata access; Added tests for cursor pagination behavior; Auto-generated test coverage for Slack Web API endpoints.
Dependencies
Update gem dependencies and add example projects
The gemspec now requires Faraday \>= 2.0.1 and adds dependencies on faraday-mashify, faraday-multipart, gli, hashie, and logger, while the main Gemfile adds a comprehensive set of test and linting dependencies including RuboCop 1.26.1, RSpec, VCR, and WebMock. Additionally, new example projects for files\_upload\_v2, hi\_web, new\_ticket, and oauth\_v2 have been added to demonstrate usage.
(dependencies) · high confidence
Written by watchdog.canine.dev from the codebase's own history, inside the signed delivery this page is composed from.
How this codebase got here
Baseline
- First survey — no prior run to compare against. CAI 67.
Lenses
- Code Health 100
- Architecture 66
- Maturity 57
- Readiness 79
- Security 87
Changes since last survey
- 300 commits — 262 feature/other, 38 fixes
By area
- (root) — 101 commits
- (repo) — 94 commits
- lib/slack — 50 commits
- .github/workflows — 32 commits
- spec/slack — 8 commits
- spec/fixtures — 7 commits
- lib/tasks — 4 commits
- bin/commands — 3 commits
- examples/files_upload_v2 — 1 commit
Notable commits
- fix: Fix CI not triggering on automated API update PRs by using GitHub App token
- fix: Fix RELEASING.md date format and rake release output example
- fix: Fix automatic API update
- fix: Fix default store missing event hooks
- fix: Fix deprecated installation_id parameter in github-app-token action.
- fix: Fix duplicate Authorization header in update_api workflow.
- fix: Fix link to PR
- fix: Fix text/markdown_text mutual exclusion in chat methods
- fix: Fix update_api workflow failing on non-JSON AI changelog response
- fix: Fix: coveralls closing builds.
- fix: Fix: do not resolve channel name for chat_postMessage.
- fix: Fix: don't generate 1-parameter tests for mutually exclusive parameters.
- fix: Fix: fetch entire depth of commits to avoid detached HEAD.
- fix: Fix: files_upload_v2 with channel.
- fix: Fix: https://github.com/slack-ruby/slack-ruby-client/pull URL.
- fix: Fix: integ test badge.
- fix: Fix: remove unnecessary patch.
- fix: Fix: resolve undocumented groups to default.
- fix: Fix: rewind body before reading it.
- fix: Fix: rubocop-friendly event handler generator.
- …and 280 more
Written by watchdog.canine.dev from the codebase's own history, inside the signed delivery this page is composed from.
Survey your own repository
slack-ruby/slack-ruby-client was measured the same way every project in this corpus was: the same rubric, at a pinned commit, with the result published in full. Point a surveyor at a repository you know and see whether you agree with it.
About this page
- The score is its most recent published measurement, taken on 20 September 2026 at a pinned commit. It is not a live figure and does not change until the project is measured again.
- Measured at commit 82acd54c1aeca60c0a2895113db2b950f12fc72e — the exact code this score is about.
- Scored under rubric-2026.09.15 — the same rubric and the same method as every other entry in this index.
- Measured by watchdog.canine.dev using codehealth-analyzer preprod-b51f968c9b10.