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
980
@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
680
Rustでオブジェクト指向エクササイズやってみた / OOP exercise in Rust
roadagain
0
420
RegExp the lifehack
roadagain
0
110
Other Decks in Programming
See All in Programming
A comprehensive view of refactoring
marabesi
0
970
第9回 情シス転職ミートアップ 株式会社IVRy(アイブリー)の紹介
ivry_presentationmaterials
1
220
コードの90%をAIが書く世界で何が待っているのか / What awaits us in a world where 90% of the code is written by AI
rkaga
44
29k
XSLTで作るBrainfuck処理系
makki_d
0
210
今ならAmazon ECSのサービス間通信をどう選ぶか / Selection of ECS Interservice Communication 2025
tkikuc
15
3k
Kotlin エンジニアへ送る:Swift 案件に参加させられる日に備えて~似てるけど色々違う Swift の仕様 / from Kotlin to Swift
lovee
1
250
GraphRAGの仕組みまるわかり
tosuri13
7
480
Blazing Fast UI Development with Compose Hot Reload (droidcon New York 2025)
zsmb
1
170
関数型まつりレポート for JuliaTokai #22
antimon2
0
140
AIネイティブなプロダクトをGolangで挑む取り組み
nmatsumoto4
0
120
レガシーシステムの機能調査・開発におけるAI利活用
takuya_ohtonari
0
610
Azure AI Foundryではじめてのマルチエージェントワークフロー
seosoft
0
110
Featured
See All Featured
Fireside Chat
paigeccino
37
3.5k
Why Our Code Smells
bkeepers
PRO
337
57k
Six Lessons from altMBA
skipperchong
28
3.8k
Principles of Awesome APIs and How to Build Them.
keavy
126
17k
Art, The Web, and Tiny UX
lynnandtonic
299
21k
Keith and Marios Guide to Fast Websites
keithpitt
411
22k
Building a Scalable Design System with Sketch
lauravandoore
462
33k
4 Signs Your Business is Dying
shpigford
184
22k
Performance Is Good for Brains [We Love Speed 2024]
tammyeverts
10
920
What’s in a name? Adding method to the madness
productmarketing
PRO
22
3.5k
Docker and Python
trallard
44
3.4k
The Success of Rails: Ensuring Growth for the Next 100 Years
eileencodes
45
7.4k
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を立てました プルリクチャンス