Upgrade to Pro
— share decks privately, control downloads, hide ads and more …
Speaker Deck
Features
Speaker Deck
PRO
Sign in
Sign up for free
Search
Search
@slack/bolt on Cloud Functions for Firebase
Search
Roadagain
July 26, 2019
Programming
2
1k
@slack/bolt on Cloud Functions for Firebase
gotanda.js #12 LT登壇スライド
Roadagain
July 26, 2019
Tweet
Share
More Decks by Roadagain
See All by Roadagain
StorybookでモジュールモードのVuex storeを利用する / Use Modules mode Vuex store in Storybook
roadagain
0
1.1k
HL-Report コントラクト開発裏話 / Developing Contracts of HL-Report
roadagain
1
720
Rustでオブジェクト指向エクササイズやってみた / OOP exercise in Rust
roadagain
0
450
RegExp the lifehack
roadagain
0
130
Other Decks in Programming
See All in Programming
go directiveを最新にしすぎないで欲しい話──あるいは、Go 1.26からgo mod initで作られるgo directiveの値が変わる話 / Go 1.26 リリースパーティ
arthur1
2
550
LangChain4jとは一味違うLangChain4j-CDI
kazumura
1
180
エージェント開発初心者の僕がエージェントを作った話と今後やりたいこと
thasu0123
0
250
Vuetify 3 → 4 何が変わった?差分と移行ポイント10分まとめ
koukimiura
0
140
野球解説AI Agentを開発してみた - 2026/02/27 LayerX社内LT会資料
shinyorke
PRO
0
310
「抽象に依存せよ」が分からなかった新卒1年目の私が Goのインターフェースと和解するまで
kurogenki
0
120
The Past, Present, and Future of Enterprise Java
ivargrimstad
0
560
AI駆動開発の本音 〜Claude Code並列開発で見えたエンジニアの新しい役割〜
hisuzuya
4
510
Ruby and LLM Ecosystem 2nd
koic
1
810
Claude Code の Skill で複雑な既存仕様をすっきり整理しよう
yuichirokato
1
380
Cyrius ーLinux非依存にコンテナをネイティブ実行する専用OSー
n4mlz
0
150
「やめとこ」がなくなった — 1月にZennを始めて22本書いた AI共創開発のリアル
atani14
0
390
Featured
See All Featured
Building a Scalable Design System with Sketch
lauravandoore
463
34k
Evolution of real-time – Irina Nazarova, EuRuKo, 2024
irinanazarova
9
1.2k
Exploring anti-patterns in Rails
aemeredith
2
290
ラッコキーワード サービス紹介資料
rakko
1
2.6M
Pawsitive SEO: Lessons from My Dog (and Many Mistakes) on Thriving as a Consultant in the Age of AI
davidcarrasco
0
86
Design of three-dimensional binary manipulators for pick-and-place task avoiding obstacles (IECON2024)
konakalab
0
380
Thoughts on Productivity
jonyablonski
75
5.1k
Why Our Code Smells
bkeepers
PRO
340
58k
Claude Code どこまでも/ Claude Code Everywhere
nwiizo
64
53k
Getting science done with accelerated Python computing platforms
jacobtomlinson
2
140
How Software Deployment tools have changed in the past 20 years
geshan
0
33k
Measuring Dark Social's Impact On Conversion and Attribution
stephenakadiri
1
160
Transcript
@slack/bolt on Cloud Functions for Firebase Roadagain
自己紹介 export default { name: ‘Roadagain’, twitter: ‘@ringoh72’, age: 21,
company: ‘Mobile Factory, Inc.’, organization: “Kosen 13s’”, }
はじめに
seratchさんがいらっしゃると聞いて ビビり散らしてます
ここから本編
@slack/boltとは slack botを開発するためのフレームワーク より簡単にbotが作れる 使った感じwebhookよりは楽だったけど、 他はやったことがないので比較対象がない…
Cloud Functions for Firebaseとは 公式ドキュメントによると Firebase機能やHTTPSリクエストによってトリガーされた イベントに応じて、バックエンドコードを自動的に実行できます。 つまりFirebaseのLambda https://firebase.google.com/docs/functions
Kosen 13s’ slackでの出来事
「bolt使ってみようぜ」
「bolt使ってみようぜ」 Iruyan-Zak「どこで動かそうか」 Roadagain「Firebaseがいい!」 Iruyan-Zak「じゃあそれでいこう」
「bolt使ってみようぜ」 Roadagain「とりあえずサンプルコードは写した」 Roadagain「繋ぎ込み…どうやるの…?」
requestとresponseを受け取ってcallback的にresponseを返す express的なやり方 Cloud Functions for Firebaseの書き方
eventを受け取ってなんやかやする requestやらresponseやらはラップされているっぽい @slack/boltの書き方
繋ぎ込み分からない Roadagain「分からない…ググろう」
bolt firebase cloud functions
bolt firebase cloud functions ヒットするのはfirebase-bolt Realtime Database用のセキュリティルールコンパイラ 今はもう開発止まってるっぽい? なんにせよ紛らわしい
今はそうでもないみたい
slack bolt firebase cloud functions
slack bolt firebase cloud functions boltじゃなくてbotでヒットしてる
「bolt使ってみようぜ」 Roadagain「もうだめだぁ…おしまいだぁ…」
Iruyan-Zakがissueを見つけてくる
Iruyan-Zakがissueを見つけてくる
Iruyan-Zakがissueを見つけてくる seratch/bolt-on-cloud-functions-for-firebase
ExpressReceiverでいけるらしい https://github.com/seratch/bolt-on-cloud-functions-for-firebase/blob/master/functions/index.js ・ ・ ・
ExpressReceiverでいけるらしい https://github.com/seratch/bolt-on-cloud-functions-for-firebase/blob/master/functions/index.js ・ ・ ・
ExpressReceiverでいけるらしい ExpressReceiver.appはexpressのインスタンス →つまりcloud functionsと形式が合う! https://github.com/slackapi/bolt/blob/master/src/ExpressReceiver.ts#L40 ・ ・ ・
早速パクる
早速パクる
各種トークン・シークレットの埋め込み firebase functions:config:set を利用して埋め込む https://firebase.google.com/docs/functions/config-env
各種トークン・シークレットの埋め込み 埋め込まれたconfigは firebase functions:config:get で取得可能 https://firebase.google.com/docs/functions/config-env
各種トークン・シークレットの埋め込み functionsのコードでは functions.config() を使って参照 https://firebase.google.com/docs/functions/config-env
None
// ここでデモする
まとめ • boltは楽にbotが作れる • ExpressReceiverを使えばCloud Functions for Firebaseでも動く • Cloud
Functionsからbolt⚡が届く
Special Thanks Kosen 13s’のslackを実験場に提供してくれたいるやん (@Iruyan_ZAK) firebaseでのサンプルを作ってくださっていたseratchさん (@seratch_ja) ありがとうございました
おまけ @slack/boltのlint通ってなかったのでissueを立てました プルリクチャンス