Noteworthy Updates to the Slack Node SDK
A modern take on the Slack Platform in Node.js
Good news: version 4.0 of the Slack Node SDK is now available. You can install the package from npm today (
@slack/client), which includes TypeScript definitions, more usable APIs, and performance improvements. If you’ve built a Slack app using older SDK releases, read our migration guide to update to the newest version.
This update goes beyond the evolutionary steps we’ve delivered in previous Node SDK versions, and debuts some highly requested features. Let’s jump straight into the highlights.
Delightful development with typed interfaces
In version 4, we’re making that information clear by maintaining our SDK source code in TypeScript.
Declaring the SDK interfaces with explicit types opens the door for smarter code completion, saving you development time. The best part is you won’t need to do anything differently: many modern code editors (like Atom, VS Code, and WebStorm) light up with these hints. Depending on your editor of choice, you can use this information for linting, interactive error highlighting, or refactoring across files. Even classic editors like vim and emacs have plugins that take advantage of the declarative types.
Building with intuition
In this update, you should find yourself making fewer round trips to our documentation because we’re ditching positional arguments in favor a plain object dictionary to contain them.
Each of the Slack platform’s Web API methods have a set a required and optional arguments. In previous versions of the SDK, you had to know which arguments were required, and in which order. Now, you supply the arguments in a key-value object, so the order doesn’t matter.
Gone are the days of receiving indecipherable error, only to find out you’d accidentally misunderstood the order of the arguments.
Predictably paced updates
Many enterprise companies require predictable release cycles with established support timelines. When the Node.js Foundation published the Long-Term Support (LTS) schedule, it enabled many large companies to depend on the technology for business-critical projects. Building off of that success, we’re introducing a support schedule for the Node Slack SDK so you can plan more effectively.
TL;DR: Once a year, when the Node.js LTS schedule specifies that a version is being retired, we may also drop support for a major version of the Slack Node SDK. Once announced, you’ll have at least 90 days to decide on your migration strategy. Visit our wiki for more detail on the Node SDK support schedule.
Migrating from previous versions
We’ve compiled a migration guide that walks you through each of the API changes that could impact your code if you’re coming from a previous version.
The most notable change, as we announced in v3.15.0, is that DataStore will not be coming along for the ride. As the Slack Platform has evolved to include Slack Enterprise Grid and Shared Channels, many of DataStore’s core design assumptions didn’t hold. If your app uses DataStore, this guide provides instructions for moving away from it.