Name | Modified | Size | Downloads / Week |
---|---|---|---|
Parent folder | |||
@slack_bolt@4.5.0 source code.tar.gz | 2025-10-07 | 2.1 MB | |
@slack_bolt@4.5.0 source code.zip | 2025-10-07 | 2.3 MB | |
README.md | 2025-10-07 | 19.7 kB | |
Totals: 3 Items | 4.4 MB | 2 |
AI-Enabled Features: Loading States, Text Streaming, and Feedback Buttons
🍿 Preview
https://github.com/user-attachments/assets/bc16597b-1632-46bb-b7aa-fe22330daf84
⚡ Getting Started
Try the AI Agent Sample app to explore the AI-enabled features and existing Assistant helper:
:::bash
# Create a new AI Agent app
$ slack create slack-ai-agent-app --template slack-samples/bolt-js-assistant-template
$ cd slack-ai-agent-app/
# Add your OPENAI_API_KEY
$ export OPENAI_API_KEY=sk-proj-ahM...
# Run the local dev server
$ slack run
⌛ Loading States
Loading states allows you to not only set the status (e.g. "My app is typing...") but also sprinkle some personality by cycling through a collection of loading messages:
Web Client SDK:
:::javascript
app.event('message', async ({ client, context, event, logger }) => {
// ...
await client.assistant.threads.setStatus({
channel_id: channelId,
thread_ts: threadTs,
status: 'thinking...',
loading_messages: [
'Teaching the hamsters to type faster…',
'Untangling the internet cables…',
'Consulting the office goldfish…',
'Polishing up the response just for you…',
'Convincing the AI to stop overthinking…',
],
});
// Start a new message stream
});
Assistant Class:
:::javascript
const assistant = new Assistant({
threadStarted: assistantThreadStarted,
threadContextChanged: assistantThreadContextChanged,
userMessage: async ({ client, context, logger, message, getThreadContext, say, setTitle, setStatus }) => {
await setStatus({
status: 'thinking...',
loading_messages: [
'Teaching the hamsters to type faster…',
'Untangling the internet cables…',
'Consulting the office goldfish…',
'Polishing up the response just for you…',
'Convincing the AI to stop overthinking…',
],
});
},
});
🔮 Text Streaming Helper
The client.chatStream()
helper utility can be used to streamline calling the 3 text streaming methods:
:::javascript
app.event('message', async ({ client, context, event, logger }) => {
// ...
// Start a new message stream
const streamer = client.chatStream({
channel: channelId,
recipient_team_id: teamId,
recipient_user_id: userId,
thread_ts: threadTs,
});
// Loop over OpenAI response stream
// https://platform.openai.com/docs/api-reference/responses/create
for await (const chunk of llmResponse) {
if (chunk.type === 'response.output_text.delta') {
await streamer.append({
markdown_text: chunk.delta,
});
}
}
// Stop the stream and attach feedback buttons
await streamer.stop({ blocks: [feedbackBlock] });
});
🔠 Text Streaming Methods
Alternative to the Text Streaming Helper is to call the individual methods.
1) client.chat.startStream
First, start a chat text stream to stream a response to any message:
:::javascript
app.event('message', async ({ client, context, event, logger }) => {
// ...
const streamResponse = await client.chat.startStream({
channel: channelId,
recipient_team_id: teamId,
recipient_user_id: userId,
thread_ts: threadTs,
});
const streamTs = streamResponse.ts
2) client.chat.appendStream
After starting a chat text stream, you can then append text to it in chunks (often from your favourite LLM SDK) to convey a streaming effect:
:::javascript
for await (const chunk of llmResponse) {
if (chunk.type === 'response.output_text.delta') {
await client.chat.appendSteam({
channel: channelId,
markdown_text: chunk.delta,
ts: streamTs,
});
}
}
3) client.chat.stopStream
Lastly, you can stop the chat text stream to finalize your message:
:::javascript
await client.chat.stopStream({
blocks: [feedbackBlock],
channel: channelId,
ts: streamTs,
});
👍🏻 Feedback Buttons
Add feedback buttons to the bottom of a message, after stopping a text stream, to gather user feedback:
:::javascript
const feedbackBlock = {
type: 'context_actions',
elements: [{
type: 'feedback_buttons',
action_id: 'feedback',
positive_button: {
text: { type: 'plain_text', text: 'Good Response' },
accessibility_label: 'Submit positive feedback on this response',
value: 'good-feedback',
},
negative_button: {
text: { type: 'plain_text', text: 'Bad Response' },
accessibility_label: 'Submit negative feedback on this response',
value: 'bad-feedback',
},
}],
};
// Using the Text Streaming Helper
await streamer.stop({ blocks: [feedbackBlock] });
:::javascript
// Or, using the Text Streaming Method
await client.chat.stopStream({
blocks: [feedbackBlock],
channel: channelId,
ts: streamTs,
});
What's Changed
👾 Enhancements
- feat: add ai-enabled features text streaming methods, feedback blocks, and loading state in https://github.com/slackapi/bolt-js/pull/2674 - Thanks @zimeg!
🐛 Bug fixes
- Fix: allows Assistant say function to properly pass metadata in https://github.com/slackapi/bolt-js/pull/2569 - Thanks @jamessimone!
- fix: better ES module support for App class in https://github.com/slackapi/bolt-js/pull/2632 - Thanks @malewis5!
- fix(typescript): accept empty list of suggested prompts for the assistant class in https://github.com/slackapi/bolt-js/pull/2650 - Thanks @zimeg!
📚 Documentation
- docs(fix): redirect links for project package migration guides to the tools site in https://github.com/slackapi/bolt-js/pull/2539 - Thanks @zimeg!
- Docs: moved over custom steps dynamic options page. in https://github.com/slackapi/bolt-js/pull/2552 - Thanks @technically-tracy!
- docs: updated nav in https://github.com/slackapi/bolt-js/pull/2564 - Thanks @technically-tracy!
- docs: rotate tokens on a separate schedule with the oauth package in https://github.com/slackapi/bolt-js/pull/2558 - Thanks @zimeg!
- docs: guide quick start app creation using the slack cli in https://github.com/slackapi/bolt-js/pull/2535 - Thanks @zimeg!
- Update event-listening.md in https://github.com/slackapi/bolt-js/pull/2584 - Thanks @jfbn!
- docs: Update language around AI apps in https://github.com/slackapi/bolt-js/pull/2606 - Thanks @haleychaas!
- docs: fix listener middleware function and use global middleware examples in https://github.com/slackapi/bolt-js/pull/2610 - Thanks @zimeg!
- docs: update ai hugging face tutorial examples in https://github.com/slackapi/bolt-js/pull/2613 - Thanks @zimeg!
- docs: guide building an app tutorial using the slack cli in https://github.com/slackapi/bolt-js/pull/2597 - Thanks @zimeg!
- docs: use the app logger in examples in https://github.com/slackapi/bolt-js/pull/2651 - Thanks @zimeg!
- docs: updates for combined quickstart in https://github.com/slackapi/bolt-js/pull/2661 - Thanks @haleychaas!
🤖 Dependencies
- Update axios dependency to version ^1.12.0 in https://github.com/slackapi/bolt-js/pull/2657 - Thanks @malewis5!
- chore(deps): update @slack/web-api requirement from ^7.9.1 to ^7.9.2 in https://github.com/slackapi/bolt-js/pull/2541 - Thanks @dependabot[bot]!
- chore(deps): update @slack/bolt requirement from ^4.3.0 to ^4.4.0 in /examples/deploy-heroku in https://github.com/slackapi/bolt-js/pull/2542 - Thanks @dependabot[bot]!
- chore(deps): update @slack/bolt requirement from ^4.3.0 to ^4.4.0 in /examples/getting-started-typescript in https://github.com/slackapi/bolt-js/pull/2543 - Thanks @dependabot[bot]!
- chore(deps): update @slack/bolt requirement from ^4.3.0 to ^4.4.0 in /examples/oauth in https://github.com/slackapi/bolt-js/pull/2544 - Thanks @dependabot[bot]!
- chore(deps): update @slack/bolt requirement from ^4.3.0 to ^4.4.0 in /examples/oauth-express-receiver in https://github.com/slackapi/bolt-js/pull/2545 - Thanks @dependabot[bot]!
- chore(deps): update @slack/bolt requirement from ^4.3.0 to ^4.4.0 in /examples/socket-mode-oauth in https://github.com/slackapi/bolt-js/pull/2546 - Thanks @dependabot[bot]!
- chore(deps): update @slack/bolt requirement from ^4.3.0 to ^4.4.0 in /examples/deploy-aws-lambda in https://github.com/slackapi/bolt-js/pull/2547 - Thanks @dependabot[bot]!
- chore(deps): update @slack/bolt requirement from ^4.3.0 to ^4.4.0 in /examples/socket-mode in https://github.com/slackapi/bolt-js/pull/2548 - Thanks @dependabot[bot]!
- chore(deps): update @slack/bolt requirement from ^4.3.0 to ^4.4.0 in /examples/message-metadata in https://github.com/slackapi/bolt-js/pull/2549 - Thanks @dependabot[bot]!
- chore(deps): bump the docusaurus group in /docs with 5 updates in https://github.com/slackapi/bolt-js/pull/2553 - Thanks @dependabot[bot]!
- chore(deps): bump brace-expansion from 1.1.11 to 1.1.12 in /docs in https://github.com/slackapi/bolt-js/pull/2574 - Thanks @dependabot[bot]!
- chore(deps): update @slack/web-api requirement from ^7.9.2 to ^7.9.3 in https://github.com/slackapi/bolt-js/pull/2578 - Thanks @dependabot[bot]!
- chore(deps): bump dotenv from 16.6.1 to 17.0.0 in /examples/getting-started-typescript in https://github.com/slackapi/bolt-js/pull/2589 - Thanks @dependabot[bot]!
- chore(deps): bump dotenv from 16.6.1 to 17.0.0 in /examples/custom-receiver in https://github.com/slackapi/bolt-js/pull/2590 - Thanks @dependabot[bot]!
- chore(deps): update @slack/types requirement from ^2.14.0 to ^2.15.0 in https://github.com/slackapi/bolt-js/pull/2600 - Thanks @dependabot[bot]!
- chore(deps): bump on-headers and compression in /docs in https://github.com/slackapi/bolt-js/pull/2607 - Thanks @dependabot[bot]!
- chore(deps): bump slackapi/slack-github-action from 2.1.0 to 2.1.1 in https://github.com/slackapi/bolt-js/pull/2615 - Thanks @dependabot[bot]!
- chore(deps): bump @koa/router from 13.1.1 to 14.0.0 in /examples/custom-receiver in https://github.com/slackapi/bolt-js/pull/2622 - Thanks @dependabot[bot]!
- chore(deps): update @slack/types requirement from ^2.15.0 to ^2.16.0 in https://github.com/slackapi/bolt-js/pull/2633 - Thanks @dependabot[bot]!
- chore(deps): update @slack/web-api requirement from ^7.9.3 to ^7.10.0 in https://github.com/slackapi/bolt-js/pull/2634 - Thanks @dependabot[bot]!
- chore(deps): bump codecov/codecov-action from 5.4.3 to 5.5.0 in https://github.com/slackapi/bolt-js/pull/2643 - Thanks @dependabot[bot]!
- chore(deps): bump actions/checkout from 4.2.2 to 5.0.0 in https://github.com/slackapi/bolt-js/pull/2642 - Thanks @dependabot[bot]!
- chore(deps): update @slack/socket-mode requirement from ^2.0.4 to ^2.0.5 in https://github.com/slackapi/bolt-js/pull/2646 - Thanks @dependabot[bot]!
- chore(deps): update @slack/oauth requirement from ^3.0.3 to ^3.0.4 in https://github.com/slackapi/bolt-js/pull/2647 - Thanks @dependabot[bot]!
- chore(deps): bump codecov/codecov-action from 5.5.0 to 5.5.1 in https://github.com/slackapi/bolt-js/pull/2662 - Thanks @dependabot[bot]!
- chore(deps): bump actions/stale from 9.1.0 to 10.0.0 in https://github.com/slackapi/bolt-js/pull/2663 - Thanks @dependabot[bot]!
- chore(deps): bump actions/setup-node from 4.4.0 to 5.0.0 in https://github.com/slackapi/bolt-js/pull/2664 - Thanks @dependabot[bot]!
- chore(deps-dev): bump @types/node from 22.15.19 to 22.15.21 in https://github.com/slackapi/bolt-js/pull/2540 - Thanks @dependabot[bot]!
- chore(deps-dev): update serverless requirement from ^4.14.3 to ^4.14.4 in /examples/deploy-aws-lambda in https://github.com/slackapi/bolt-js/pull/2554 - Thanks @dependabot[bot]!
- chore(deps-dev): bump stylelint from 16.19.1 to 16.20.0 in /docs in https://github.com/slackapi/bolt-js/pull/2561 - Thanks @dependabot[bot]!
- chore(deps-dev): update serverless requirement from ^4.14.4 to ^4.15.1 in /examples/deploy-aws-lambda in https://github.com/slackapi/bolt-js/pull/2562 - Thanks @dependabot[bot]!
- chore(deps-dev): bump @types/node from 22.15.21 to 22.15.29 in https://github.com/slackapi/bolt-js/pull/2563 - Thanks @dependabot[bot]!
- chore(deps-dev): bump @types/node from 22.15.29 to 22.15.30 in https://github.com/slackapi/bolt-js/pull/2566 - Thanks @dependabot[bot]!
- chore(deps-dev): update serverless requirement from ^4.15.1 to ^4.17.0 in /examples/deploy-aws-lambda in https://github.com/slackapi/bolt-js/pull/2567 - Thanks @dependabot[bot]!
- chore(deps-dev): bump @types/node from 22.15.30 to 24.0.3 in https://github.com/slackapi/bolt-js/pull/2570 - Thanks @dependabot[bot]!
- chore(deps-dev): bump @types/node from 22.15.32 to 24.0.3 in /examples/getting-started-typescript in https://github.com/slackapi/bolt-js/pull/2571 - Thanks @dependabot[bot]!
- chore(deps-dev): bump @types/node from 22.15.32 to 24.0.3 in /examples/custom-receiver in https://github.com/slackapi/bolt-js/pull/2572 - Thanks @dependabot[bot]!
- chore(deps-dev): update serverless requirement from ^4.17.0 to ^4.17.1 in /examples/deploy-aws-lambda in https://github.com/slackapi/bolt-js/pull/2577 - Thanks @dependabot[bot]!
- chore(deps-dev): bump @types/node from 24.0.3 to 24.0.7 in https://github.com/slackapi/bolt-js/pull/2591 - Thanks @dependabot[bot]!
- chore(deps-dev): bump stylelint from 16.20.0 to 16.21.0 in /docs in https://github.com/slackapi/bolt-js/pull/2593 - Thanks @dependabot[bot]!
- chore(deps-dev): bump @types/node from 24.0.7 to 24.0.10 in https://github.com/slackapi/bolt-js/pull/2594 - Thanks @dependabot[bot]!
- chore(deps-dev): bump stylelint from 16.21.0 to 16.21.1 in /docs in https://github.com/slackapi/bolt-js/pull/2596 - Thanks @dependabot[bot]!
- chore(deps-dev): bump @types/node from 24.0.10 to 24.0.14 in https://github.com/slackapi/bolt-js/pull/2604 - Thanks @dependabot[bot]!
- chore(deps-dev): bump @types/node from 24.0.14 to 24.0.15 in https://github.com/slackapi/bolt-js/pull/2609 - Thanks @dependabot[bot]!
- chore(deps-dev): bump stylelint-config-standard from 38.0.0 to 39.0.0 in /docs in https://github.com/slackapi/bolt-js/pull/2617 - Thanks @dependabot[bot]!
- chore(deps-dev): bump @types/node from 24.0.15 to 24.2.0 in https://github.com/slackapi/bolt-js/pull/2619 - Thanks @dependabot[bot]!
- chore(deps-dev): update serverless requirement from ^4.17.1 to ^4.17.2 in /examples/deploy-aws-lambda in https://github.com/slackapi/bolt-js/pull/2621 - Thanks @dependabot[bot]!
- chore(deps-dev): bump typescript from 5.8.3 to 5.9.2 in /examples/custom-receiver in https://github.com/slackapi/bolt-js/pull/2620 - Thanks @dependabot[bot]!
- chore(deps-dev): bump typescript from 5.8.3 to 5.9.2 in /examples/getting-started-typescript in https://github.com/slackapi/bolt-js/pull/2623 - Thanks @dependabot[bot]!
- chore(deps-dev): update serverless requirement from ^4.17.2 to ^4.18.0 in /examples/deploy-aws-lambda in https://github.com/slackapi/bolt-js/pull/2624 - Thanks @dependabot[bot]!
- chore(deps-dev): bump @types/node from 24.2.0 to 24.2.1 in https://github.com/slackapi/bolt-js/pull/2626 - Thanks @dependabot[bot]!
- chore(deps-dev): bump @types/node from 24.2.1 to 24.3.0 in https://github.com/slackapi/bolt-js/pull/2635 - Thanks @dependabot[bot]!
- chore(deps-dev): update serverless requirement from ^4.18.0 to ^4.18.1 in /examples/deploy-aws-lambda in https://github.com/slackapi/bolt-js/pull/2636 - Thanks @dependabot[bot]!
- chore(deps-dev): bump @types/node from 24.3.0 to 24.3.1 in https://github.com/slackapi/bolt-js/pull/2648 - Thanks @dependabot[bot]!
- chore(deps-dev): bump @types/node from 24.3.1 to 24.4.0 in https://github.com/slackapi/bolt-js/pull/2655 - Thanks @dependabot[bot]!
- chore(deps-dev): bump @types/node from 24.4.0 to 24.5.2 in https://github.com/slackapi/bolt-js/pull/2658 - Thanks @dependabot[bot]!
- chore(deps-dev): update serverless requirement from ^4.18.1 to ^4.19.1 in /examples/deploy-aws-lambda in https://github.com/slackapi/bolt-js/pull/2659 - Thanks @dependabot[bot]!
- chore(deps-dev): bump @types/node from 24.5.2 to 24.7.0 in https://github.com/slackapi/bolt-js/pull/2669 - Thanks @dependabot[bot]!
- chore(deps-dev): update serverless requirement from ^4.19.1 to ^4.20.2 in /examples/deploy-aws-lambda in https://github.com/slackapi/bolt-js/pull/2670 - Thanks @dependabot[bot]!
- chore(deps-dev): bump typescript from 5.9.2 to 5.9.3 in /examples/custom-receiver in https://github.com/slackapi/bolt-js/pull/2671 - Thanks @dependabot[bot]!
- chore(deps-dev): bump typescript from 5.9.2 to 5.9.3 in /examples/getting-started-typescript in https://github.com/slackapi/bolt-js/pull/2672 - Thanks @dependabot[bot]!
🧰 Maintaince
- ci: pin actions workflow step hashes and use minimum permissions in https://github.com/slackapi/bolt-js/pull/2537 - Thanks @zimeg!
- chore: update dependabot to open one PR for all @slack dependencies in /examples in https://github.com/slackapi/bolt-js/pull/2550 - Thanks @WilliamBergamin!
- Revert "chore: update dependabot to open one PR for all @slack depend… in https://github.com/slackapi/bolt-js/pull/2551 - Thanks @WilliamBergamin!
- build: clone repository "docs" and configuration when syncing project docs + removing separate docusaurus build in https://github.com/slackapi/bolt-js/pull/2586 - Thanks @lukegalbraithrussell!
- Revert "build: clone repository "docs" and configuration when syncing project docs + removing separate docusaurus build" in https://github.com/slackapi/bolt-js/pull/2595 - Thanks @lukegalbraithrussell!
- refactor: check payload type before extracting assistant thread info in https://github.com/slackapi/bolt-js/pull/2603 - Thanks @zimeg!
- ci: send a notification of scheduled failing tests in https://github.com/slackapi/bolt-js/pull/2601 - Thanks @zimeg!
- ci: output verbose details when installing packages for tests in https://github.com/slackapi/bolt-js/pull/2602 - Thanks @zimeg!
- Build: remove docusaurus configuration files in https://github.com/slackapi/bolt-js/pull/2614 - Thanks @lukegalbraithrussell!
- test: swap rewiremock with proxyquire in https://github.com/slackapi/bolt-js/pull/2629 - Thanks @WilliamBergamin!
- ci: post regression notifications if scheduled tests do not succeed in https://github.com/slackapi/bolt-js/pull/2667 - Thanks @zimeg!
- chore(release): version @slack/bolt@4.5.0 in https://github.com/slackapi/bolt-js/pull/2675 - Thanks @zimeg!
New Contributors 🎉
- @jamessimone made their first contribution in https://github.com/slackapi/bolt-js/pull/2569
- @jfbn made their first contribution in https://github.com/slackapi/bolt-js/pull/2584
- @malewis5 made their first contribution in https://github.com/slackapi/bolt-js/pull/2632
Milestone: https://github.com/slackapi/bolt-js/milestone/59?closed=1 Full Changelog: https://github.com/slackapi/bolt-js/compare/@slack/bolt@4.4.0...@slack/bolt@4.5.0