개발자

Build Slack apps in a flash

Introducing the newest member of the Bolt family

작성자: Shay DeWael2020년 11월 9일Chris Gash의 일러스트

In April 2020, we released Bolt, a JavaScript framework that offers a standardized, high-level interface to simplify and speed up the development of Slack apps.

Since then, we’ve seen a remarkable community of developers build with and contribute to Bolt, signaling an appetite for frameworks in other programming languages. Since its initial release, Bolt is also available in Java—and today, in Python.

Interested in seeing our latest addition in action? You can watch our webinar about building with Bolt for Python at any time.

Designing Bolt for simple, custom building

In the months leading up to the release of Bolt for JavaScript, our small development team held weekly white-boarding sessions (developing a recursive middleware processor was not as easy as we expected). We pushed hundreds of commits, took countless coffee breaks, and followed the guidance of JavaScript community principles.

Developing Bolt for Java and Python, we knew we needed to customize them to best fit each unique language community. As we proceeded, we made small modifications to the different frameworks—in Java we modified how we pass in listener arguments, and in Python we adapted Bolt to work with existing web frameworks, like Flask.

Our specialized approach was complementary to Bolt’s core design principles.

A common listener pattern

A common listener pattern simplifies building with all the different platform features

Bolt is built around a set of listener methods. These are used to listen to and interact with different events coming from Slack. For example, Events API events use the events() listener, and shortcut invocations use the shortcut() listener. All listeners use common parameters that allow you to define unique identifiers, add middleware, and access the body of incoming events.

A handful of built-in defaults

Built-in OAuth support makes multi-team installation faster and more intuitive

Bolt includes a collection of defaults that perform the heavier lifting of building Slack apps. One of these is a design pattern called receivers, or adapters in Python. These separate the concerns of your app’s server and the Bolt framework so updates for server logic don’t require framework updates, and vice versa.

Your app has access to a built-in Web API client that includes features such as built-in retry logic, rate-limit handling and pagination support as you make calls to any of our more than 130 methods. It offers a simple way to call Web API methods without having to think of all the possible edge cases. And Bolt offers OAuth support, which handles the “Add to Slack” flow, making token storage and access for multi-team installations simpler.

Helper functions and objects

The say() helper is available in all listeners that have a conversation context

To complete common tasks, Bolt includes a set of helper functions. For example, in any listener with an associated conversation context, there will be a say() function that lets your app send a message back into that channel. And for events that need to be acknowledged within three seconds, Bolt surfaces an ack() function that streamlines the act of responding.

Bolt also offers helpers that make it easier to inspect and pass data through your app. Rather than having to unwrap incoming events to access the most important information, Bolt includes a payload object that is a predictable, unwrapped event (though you’ll still have body for the more verbose event).

You can also access context, which is a key/value dictionary that allows you to pass data through middleware and listeners. For example, if you have an internal data store that you want to associate with incoming events, you can create a global middleware function to store that information in context, which will be natively accessible in listeners.

The future of Bolt

As the platform grows, we will continue our investment in Bolt to make it easier, faster and more intuitive to build Slack apps.

For example, steps from apps are now available in Workflow Builder. Each workflow step has a few associated events, so we collaborated with the Workflow Builder engineering team to design a common pattern in Bolt that lets you centrally handle the entire lifecycle of a workflow step.

Recently, we announced Socket Mode, which improves the experience of deploying apps behind a firewall. Bolt apps gain support for this feature as well, with minimal code changes.

We’re also unlocking more Bolt resources for custom use cases— whether that’s specialized hosting environments, simplifying new features, or building scalable apps for Enterprise Grid and Slack Connect. We’ll continue to expand our collection of Bolt-focused code samples, tutorials, deployment guides and webinars, and if you need a more specialized approach to building Slack apps, we have ongoing plans for our lower-level SDKs that power Bolt under the hood.

Digging into the nuts and bolts

You can start building with Bolt using our guides in Python, JavaScript and Java.

If you’re a JavaScript developer, you can read our new hosting guides to get your app up and running on Heroku, with an equivalent for AWS Lambda coming soon.

Questions? Email feedback@slack.com, or reach out to our team on GitHub.

이 포스트가 유용했나요?

0/600

훌륭해요!

피드백을 주셔서 감사합니다.

알겠습니다!

피드백을 주셔서 감사합니다.

죄송합니다. 문제가 발생했습니다. 나중에 다시 시도해주세요.

계속 읽기

생산성

더 나은 업무 결과를 위해 꼭 알아야 할 프로젝트 관리 5단계

Slack은 프로젝트 관리를 위한 대표적인 기업용 메시징 기반 업무 플랫폼입니다. 프로젝트 참여자가 한 공간에 모두 모여 어떠한 문제에 대해 즉시 논의하고 의사결정을 할 수 있기 때문입니다.

새 소식

Slack과 세일즈포스에서 팀의 성과 달성을 앞당기는 새로운 도구 출시

팀, 도구 및 데이터 간의 격차를 해소하여 모두가 더 빠르게 협업함으로써 고객 중심 솔루션을 제공하기 위한 방법

혁신

포춘 선정 100대 기업의 약 80%가 Slack Connect를 사용하여 Digital HQ를 구축하는 이유

수상 경력에 빛나는 이 제품을 사용하여 고객 관계를 강화하고 외부 파트너와 원활한 커뮤니케이션을 구축하세요.

개발자

Donut에서 팀 문화를 개선하는 Slack 중심 비즈니스를 구축한 방법

Slack의 내장된 도달 범위와 배포로 강화된 Donut의 연결 도구는 사용자가 어디에 있든 직관적으로 연결할 수 있도록 도와줍니다.