Firebase Functions - Il lato chiaro della Forza
Michel MurabitoFullStackConf - Torino - 10 Ottobre 2019
Firebase Functions - Il lato chiaro della Forza
Michel MurabitoFullStackConf - Torino - 10 Ottobre 2019
About Me
My name is Michel Murabito but everybody calls me Mich
Michel Murabito@michelmurabito
About MeDeputy CTO by day,
Developer in the soul,Superhero wannabe by night...
Michel Murabito@michelmurabito
michelmurabito
Deputy CTO by day,
I’m the Deputy CTO in
About Me
Michel Murabito@michelmurabito
michelmurabito
● Intro Firebase
● Firebase Functions (Trigger & Cron)
● Admin Library
Agenda
Firebase Functions - Il lato chiaro della Forza
michelmurabito
The Kessel Run in less than 12 parsecs
michelmurabito
michelmurabito
Firebase Functions
Supported Languages / FrameworkLanguages● JavaScript● TypeScript (recommended)Framework● NodeJS
michelmurabito
Firebase Functions - Install
Start with Firebase FunctionsInstall Node.JS ● For try in your local environment
Install Firebase CLI● npm i -g firebase-tools
michelmurabito
Firebase Functions - Setup
● firebase login*** Login Google
● firebase init*** Select Project (or create a new project)*** Select Functions (+ other Firebase Features)*** JavaScript o TypeScript*** Linting?*** Install Dependency?
How init the Firebase project?
michelmurabito
Firebase Functions - Setup
Firebase Functions - TriggersHow run an Firebase Function?
michelmurabito
Firebase Functions - TriggersHow run an Firebase Function?
Event:● Realtime Database, Firestore, Storage Bucket, etc● Firebase Authentication● Analytics ConversionRequest:● HTTPs request● From your App (with SDK Web, Android, iOS)Schedule:● Each {{X}}time
michelmurabito
Firebase Functions - Hello World
michelmurabito
Firebase Functions - Hello World
michelmurabito
Firebase Functions - Hello World
michelmurabito
Firebase Functions - Hello World
michelmurabito
Firebase Functions - Hello World
michelmurabito
Firebase Functions - HTTP
A proper (HTTP) Function:● Return a response
or● Return a promise
(with a proper resolve and reject)
NB: with an HTTP request you can interact with DB (Real Time and Firestore), Storage, Messaging etc
michelmurabito
Firebase Functions - Deploy
● firebase deploy
How deploy an Firebase Function?
michelmurabito
Firebase Functions - DB Trigger
michelmurabito
Firebase Functions - DB Trigger
Firebase Functions - DB Trigger
Firebase Functions - DB Trigger
Firebase Functions - DB Trigger
Firebase Functions - DB Trigger
Firebase Functions - CronJob
michelmurabito
Firebase Functions - CronJob
michelmurabito
Firebase Functions - CronJob
michelmurabito
Firebase Functions - CronJob
michelmurabito
Firebase Functions - Admin Library
michelmurabito
Firebase Functions - Admin Library
michelmurabito
Firebase Functions - Admin Library
michelmurabito
Firebase Functions - Admin Library
michelmurabito
Firebase Functions - Admin Library
michelmurabito
Firebase Functions - Admin Library
michelmurabito
Firebase Functions - Admin Library
michelmurabito
Firebase Functions - Admin Library
michelmurabito
Firebase Functions - Cold Start Time
michelmurabito
Firebase Functions - Cold Start Time
michelmurabito
Firebase Functions - Cold Start Time
michelmurabito
Firebase Functions - Cold Start Time
● Less import (on the top)
● Avoid crash of the function
How to decrease startup time?
michelmurabito
Firebase Functions & Firebase Extensions
michelmurabito
Firebase Functions & Firebase Extensions
michelmurabito
Tips ‘n’ Tricks
Resource● Intro to Firebase: https://www.youtube.com/watch?v=2S91znPavrQ● Intro Firebase + Angular: https://www.youtube.com/watch?v=DUGA8sOdjiA● Cold start time: https://www.youtube.com/watch?v=v3eG9xpzNXM● Trigger:
○ https://www.youtube.com/watch?v=DglTSNEdl0U○ https://www.youtube.com/watch?v=Bdm7QNwSHOg○ https://www.youtube.com/watch?v=7IkUgCLr5oA○ https://www.youtube.com/watch?v=652XeeKNHSk○ https://www.youtube.com/watch?v=d9GrysWH1Lc
● Code:○ https://github.com/firebase/functions-samples
● Firebase Documentation:○ https://firebase.google.com/docs
● Firebase on YouTube:○ https://www.youtube.com/user/Firebase?hl=it
michelmurabito
Feedback & Q&A
goo.gl/4BGk8tmichelmurabito
Michel Murabito@michelmurabito
<thank-you>
Top Related