-
Notifications
You must be signed in to change notification settings - Fork 662
Migration Guide for socket‐mode 2.0
Fil Maj edited this page Apr 30, 2024
·
1 revision
This migration guide helps you transition an application written using the v1.x
series of the @slack/socket-mode
package to the v2.x
series. This guide focuses specifically on the breaking changes to help get your existing projects up and running as
quickly as possible.
npm i @slack/socket-mode
- Two Lifecycle Events have been removed:
-
authenticated
. This event corresponded to the client retrieving a response from theapps.connections.open
Slack API - but it didn't signal anything about the actual socket connection that matters! If you had been listening to this event, we recommend moving instead to one of these two events:-
connected
. This signals that the client has established a connection with Slack and has received ahello
message from the Slack backend. Events will start flowing to your app after this event. -
connecting
. This signals that the client is about to establish a connection with Slack. If you were usingauthenticated
to be notified before the client establishes a connection, we recommend using this event instead.
-
-
unable_to_socket_mode_start
. This event corresponded to an error happening when attempting to hit theapps.connections.open
Slack API. We recommend moving instead toreconnecting
(if you have client reconnections enabled), or theerror
event.
- Two public properties on the client have been removed:
connected
andauthenticated
. Instead, we recommend migrating to theisActive()
method to determine whether the WebSocket connection powering the client is healthy.