Releases: slackapi/node-slack-sdk
Release list
@slack/webhook@8.0.0
Major Changes
-
fc98c8c: Drop Node.js 18 support. The minimum supported Node.js version is now 20.
-
fc98c8c: Restructured error classes to use proper
Errorsubclasses extending a newSlackWebhookErrorbase class.Breaking changes to
IncomingWebhookHTTPError:- The
originalproperty has been removed. HTTP response details are now direct properties:statusCode: numberstatusMessage: stringbody: string
- Migrate from
error.original.response.statustoerror.statusCode,error.original.response.datatoerror.body, etc.
Breaking changes to
IncomingWebhookRequestError:- The
originalproperty is now a standardError(previously it was anAxiosError). The original error is also available via the standardcauseproperty.
Removed factory functions (use
newwith the corresponding class instead):requestErrorWithOriginal()→new IncomingWebhookRequestError(original)httpErrorWithOriginal()→new IncomingWebhookHTTPError(statusCode, statusMessage, body)errorWithCode()— Use the specific error class directly.
Migration: Replace
if (error.code === ErrorCode.HTTPError)withif (error instanceof IncomingWebhookHTTPError). You can also catch all webhook errors withif (error instanceof SlackWebhookError).The
CodedErrorinterface is deprecated — useinstanceofchecks with theSlackWebhookErrorbase class or specific error subclasses instead. - The
-
fc98c8c: Replaced
axioswith the standard Fetch API for HTTP transport.Removed options from
IncomingWebhookDefaultArguments:agent— Use the newfetchoption to provide a custom fetch implementation with proxy or TLS support. For proxies, prefer the built-inhttp.setGlobalProxyFromEnv()orNODE_USE_ENV_PROXY=1(Node.js 24+). For advanced use cases:import { fetch, Agent } from "undici"; const webhook = new IncomingWebhook(url, { fetch: (url, init) => fetch(url, { ...init, dispatcher: new Agent({ connect: { ca: myCA } }), }), });
The
axiosdependency has been removed. The default fetch implementation isglobalThis.fetch(available in Node.js 20+). Thetimeoutoption remains available and is implemented viaAbortController.
Minor Changes
-
fc98c8c: feat: add
WebhookTriggerclass for Workflow Builder triggers and opt-in retries forIncomingWebhookandWebhookTriggerWebhookTriggersurfaces its ownWebhookTriggerHTTPErrorandWebhookTriggerRequestError(subclasses ofSlackWebhookError), so trigger failures can be distinguished fromIncomingWebhookfailures viainstanceof.
Patch Changes
- Updated dependencies [fc98c8c]
- @slack/types@3.0.0
@slack/web-api@8.0.0
Major Changes
-
fc98c8c: Drop Node.js 18 support. The minimum supported Node.js version is now 20.
-
fc98c8c: Redesigned error handling to use proper
Errorsubclasses instead of plain objects with acodeproperty.Migration: Replace
if (error.code === ErrorCode.PlatformError)withif (error instanceof WebAPIPlatformError). All error classes extend a commonSlackErrorbase class (which extendsError), so you can also catch all SDK errors withif (error instanceof SlackError).New error class hierarchy:
SlackError(abstract base)WebAPIPlatformError— Slack API returnedok: falseWebAPIRequestError— Network/transport failure (original error incause)WebAPIHTTPError— Non-200 HTTP status from SlackWebAPIRateLimitedError— HTTP 429 withretryAftersecondsWebAPIFileUploadInvalidArgumentsError— Invalid file upload argumentsWebAPIFileUploadReadFileDataError— Failed to read file data for upload
Removed factory functions (these were internal but exported — use
newwith the corresponding class instead):errorWithCode()platformErrorFromResult()→new WebAPIPlatformError(...)requestErrorWithOriginal()→new WebAPIRequestError(...)httpErrorFromResponse()→new WebAPIHTTPError(...)rateLimitedErrorWithDelay()→new WebAPIRateLimitedError(...)
Other breaking type changes:
WebAPIHTTPError.headerstype changed fromIncomingHttpHeaderstoRecord<string, string>.- The
CodedErrorinterface is deprecated — useinstanceofchecks with specific error classes instead. - Error
.namevalues changed from generic'Error'to descriptive class names (e.g.,'WebAPIPlatformError').
-
fc98c8c: Replaced
axioswith the standard Fetch API for all HTTP transport. The following options and types have been removed fromWebClientOptions:agent— Use the newfetchoption to provide a custom fetch implementation with proxy or keep-alive support. For proxies, prefer the built-inhttp.setGlobalProxyFromEnv()orNODE_USE_ENV_PROXY=1(Node.js 24+). For advanced use cases:import { fetch, Agent } from "undici"; const client = new WebClient(token, { fetch: (url, init) => fetch(url, { ...init, dispatcher: new Agent({ keepAliveTimeout: 60_000 }), }), });
tlsandTLSOptions— Configure TLS via a customfetchimplementation with an undiciAgent, or use theNODE_EXTRA_CA_CERTSenvironment variable.requestInterceptorandRequestInterceptortype — Wrap thefetchfunction to intercept or modify requests before they are sent.adapterandAdapterConfigtype — Use thefetchoption instead.RequestConfigtype (was an alias for Axios'InternalAxiosRequestConfig) — Removed entirely.attachOriginalToWebAPIRequestErroroption — Removed. The original error is now always available via the standardcauseproperty onWebAPIRequestError.
The dependencies
axios,form-data,is-electron, andis-streamhave been removed. The defaultfetchimplementation isglobalThis.fetch(available in Node.js 20+).New exported types for custom fetch implementations:
FetchFunction,FetchResponse,FetchRequestInit,FetchHeaders. -
fc98c8c: Removed previously-deprecated API methods and their associated request/response types:
files.upload— UsefilesUploadV2instead (available since v6.7). ThefilesUploadV2method handles the multi-step upload process automatically.rtm.start— Usertm.connectinstead. Thertm.startmethod was deprecated by Slack in favor of the lighter-weightrtm.connect.workflows.stepCompleted,workflows.stepFailed,workflows.updateStep— These methods supported the retired Steps from Apps feature (deprecated August 2023, retired September 2024). Theworkflows.featured.*andadmin.workflows.*methods for the current Workflow Builder remain available.
Minor Changes
- fc98c8c: feat: expand app manifest types — add
agent_viewandassistant_viewfeatures, recent agent events (app_context_changed,assistant_thread_started,assistant_thread_context_changed), optional OAuth scopes (bot_optional/user_optional), and eventmetadata_subscriptions
Patch Changes
@slack/types@3.0.0
Major Changes
- fc98c8c: Drop Node.js 18 support. The minimum supported Node.js version is now 20.
@slack/socket-mode@3.0.0
Major Changes
-
fc98c8c: Drop Node.js 18 support. The minimum supported Node.js version is now 20.
-
fc98c8c: Redesigned error handling to use proper
Errorsubclasses instead of plain objects with acodeproperty.Migration: Replace
if (error.code === ErrorCode.WebsocketError)withif (error instanceof SMWebsocketError).New error classes (all extend a common
SlackSocketModeErrorabstract base class, which extendsError):SMPlatformError— Slack platform returned an error eventSMWebsocketError— WebSocket connection failure (original error incause)SMNoReplyReceivedError— Timed out waiting for a reply to an acknowledgementSMSendWhileDisconnectedError— Attempted to send while not connectedSMSendWhileNotReadyError— Attempted to send before the connection was ready
Catch any socket-mode error with
if (error instanceof SlackSocketModeError).Removed factory functions (use
newwith the corresponding class instead):websocketErrorWithOriginal()→new SMWebsocketError(original)platformErrorFromEvent()→new SMPlatformError(event)noReplyReceivedError()→new SMNoReplyReceivedError()sendWhileDisconnectedError()→new SMSendWhileDisconnectedError()sendWhileNotReadyError()→new SMSendWhileNotReadyError()
The
CodedErrorinterface is deprecated — useinstanceofchecks with specific error classes instead. Theerror.codeproperty still exists for backward-compatible checks, buterror.namevalues changed from generic'Error'to descriptive class names (e.g.,'SMWebsocketError'). -
fc98c8c: Replaced the
wsWebSocket library with a spec-compliant WebSocket implementation backed byundici.undici@^7is now a peer dependency that must be installed alongside@slack/socket-mode:npm install @slack/socket-mode undici@^7
Removed options:
clientOptions.agent(thehttpAgentpassed to the underlying web-api client). Use the new top-leveldispatcheroption instead. The dispatcher handles both the WebSocket connection and HTTP API calls (unlessclientOptions.fetchis also provided, in which casedispatcheronly applies to WebSocket).
New
dispatcheroption:import { SocketModeClient } from "@slack/socket-mode"; import { ProxyAgent } from "undici"; const client = new SocketModeClient({ appToken: process.env.SLACK_APP_TOKEN, dispatcher: new ProxyAgent("http://proxy:3128"), });
For simple proxy use cases, prefer the Node.js built-in proxy support: call
http.setGlobalProxyFromEnv()at startup or setNODE_USE_ENV_PROXY=1(Node.js 24+) withHTTP_PROXY/HTTPS_PROXYenvironment variables.The
dispatcheroption accepts any object implementing theSocketModeDispatcherinterface (structurally compatible with undici'sAgent,ProxyAgent,Client, etc.).This package now depends on
@slack/web-api@^8— anyclientOptionsyou pass are subject to web-api v8 breaking changes (e.g., theagentandtlsoptions are no longer available; useclientOptions.fetchinstead).
Patch Changes
@slack/oauth@4.0.0
Major Changes
-
fc98c8c: Drop Node.js 18 support. The minimum supported Node.js version is now 20.
-
fc98c8c: Error classes now extend a new
SlackOAuthErrorabstract base class (which extendsError), bringing@slack/oauthin line with the error handling in@slack/web-apiand@slack/webhook. You can catch any error thrown by this package withif (error instanceof SlackOAuthError), in addition to the existing per-classinstanceofchecks (AuthorizationError,InstallerInitializationError, etc.).AuthorizationErrornow populates the standardError.causeproperty with the underlying error when one is available (for example, the failure that causedauthorize()to reject). The existingoriginalproperty is still present and carries the same value.import { AuthorizationError } from "@slack/oauth"; try { await installer.authorize({ teamId, enterpriseId }); } catch (error) { if (error instanceof AuthorizationError) { console.log(error.cause); // the underlying error console.log(error.original); // same value — kept for backward compat } }
The
error.codeproperty andErrorCodeenum values are unchanged, so existingerror.codechecks continue to work. TheCodedErrorinterface is retained (it is part of the publicCallbackOptions#failurecallback signature), but for new code we recommendinstanceofchecks againstSlackOAuthErroror a specific subclass.Note:
error.namenow reflects the specific class name (e.g.'AuthorizationError') instead of the generic'Error'. If you branch onerror.name, update those checks accordingly. -
fc98c8c: Updated the internal
@slack/web-apidependency from^7to^8. If you passclientOptionstoInstallProvider, the following options are no longer available:clientOptions.agent— UseclientOptions.fetchwith a custom fetch implementation instead.clientOptions.tls— Configure TLS viaclientOptions.fetchor theNODE_EXTRA_CA_CERTSenvironment variable.
import { InstallProvider } from "@slack/oauth"; import { fetch, Agent } from "undici"; const installer = new InstallProvider({ clientId: process.env.SLACK_CLIENT_ID, clientSecret: process.env.SLACK_CLIENT_SECRET, stateSecret: "my-secret", clientOptions: { fetch: (url, init) => fetch(url, { ...init, dispatcher: new Agent({ connect: { ca: myCA } }), }), }, });
See the
@slack/web-apiv8 changelog for the full list of breaking changes that affectclientOptions.
Patch Changes
@slack/logger@5.0.0
Major Changes
- fc98c8c: Drop Node.js 18 support. The minimum supported Node.js version is now 20.
@slack/cli-test@5.0.0
Major Changes
- fc98c8c: Drop Node.js 18 support. The minimum supported Node.js version is now 20.
@slack/cli-hooks@2.0.0
Major Changes
- fc98c8c: Drop Node.js 18 support. The minimum supported Node.js version is now 20.
@slack/webhook@7.2.0
@slack/web-api@7.19.0
Minor Changes
- a795b86: feat: expand app manifest types — add
agent_viewandassistant_viewfeatures, recent agent events (app_context_changed,assistant_thread_started,assistant_thread_context_changed), optional OAuth scopes (bot_optional/user_optional), and eventmetadata_subscriptions