Skip to content
CAI
Software that uses CAICheck a score

slack-ruby/slack-ruby-client

66.6

Adequate · 6 November 2026

1.1k

lines of production code

Ruby

primary language

4

measurements over time

CAI band scale
CAI trend line
CAI lens gauges

What this system is

This system is a Ruby library and command-line tool for interacting with the Slack Web API and Events API. It provides a structured client for making API calls, handling authentication, and managing enterprise administration tasks, while also offering utilities for message formatting and secure signature verification. The tool includes a CLI for direct Slack interaction and supports automated code generation to keep the client synchronized with Slack's evolving API specification.

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 API client by introducing support for OAuth v2 and the sequential file upload flow (files\_upload\_v2). Significant work was also dedicated to strengthening security through robust signature verification for Slack Events and comprehensive test coverage for API endpoints and utility functions.

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

Behavioural changes

Default filename for file uploads to enable Slack previews

File uploads via the Slack API now automatically include a default filename ('file') when a file is provided but no specific name is set. This ensures that Slack displays a file preview correctly instead of showing a generic or missing preview. The change is implemented in the files upload endpoint and managed via a patch file in the API patches directory.

lib/slack/web/api/patches · high confidence

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 cca.canine.dev from the codebase's own history, inside the signed delivery this page is composed from.

How this codebase got here

Score

  • CAI 66 → 67 (+1.0)
  • Rubric changed (rubric-2026.10.5 → rubric-2026.11.2) — scores are not directly comparable.

Lenses

  • Code Health 76 → 76 (+0.0)
  • Architecture 69 → 69 (+0.0)
  • Maturity 57 → 61 (+3.7)
  • Readiness 80 → 80 (+0.0)
  • Security 82 → 73 (-8.9)

Resolved (3)

  • Duplicate intent across nested config types: Slack.Config, Slack.Events.Config, and Slack.Web.Config all have a reset() method. While they operate on different scopes, the repetition suggests a shared base class or module for configuration management could reduce duplication and ensure consistent behavior.
  • Legacy vs Modern API duplication: Oauth.oauth_access corresponds to the deprecated OAuth 1.0a flow, while OauthV2.oauth_v2_access is the modern OAuth 2.0 flow. While technically distinct due to API versioning, exposing both without clear deprecation warnings or a unified oauth_access entry point that handles versioning internally can confuse users.
  • Redundant configuration methods: Every major subsystem (Slack, Events, Web, Client) exposes both a configure() and a config() method. In Ruby libraries, config is typically a getter for the configuration object/state, while configure is a setter/block-based mutator. However, exposing both on every single module creates significant API bloat and confusion about whether they are aliases or distinct operations (e.g., does config() return a mutable object that affects state, or is it a snapshot?).

Written by cca.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 6 November 2026 at a pinned commit. It is not a live figure and does not change until the project is measured again.
  • Measured at commit 7e69bd4c6474cd6eaf53f9e6cec22738c4b61a57 — the exact code this score is about.
  • Scored under rubric-2026.11.2 — the same rubric and the same method as every other entry in this index.
  • Measured by Canine Code Analyzer (cca.canine.dev) using cca measure-2026.11.2+preprod-5c4e66d9318b.