This is the full Cloud Functions code explained in my blog post: How to schedule a Cloud Function to run in the future (in order to build a Firestore document TTL)
This is the runnable sample code from the blog post [Patterns for security with Firebase Authentication: offload work to Cloud Functions][1]. It discusses offloading work from a client app to Cloud Functions using an authentication trigger.
- Create a new Firebase project
- Enable email/password authentication
- Provision Cloud Firestore and apply the rules given in this gist
- Use the Firebase CLI to create a workspace for Functions using TypeScript
- Deploy the given HTML and JavaScript to Firebase Hosting (the CLI emulator will also work).
- Deploy the function code to Cloud Functions using the Firebase CLI
Realtime Database triggers with Cloud Functions for Firebase - source
This gist contains the source code in my video series about Realtime Database triggers. You can watch the three parts here:
index.ts
contains the Cloud Functions code, and dialog.ts
contains the script to run
Example code from the video "Use async/await with TypeScript in Cloud Functions"
This is the example code from my video about using async/await with Cloud Functions. I've placed it here in a gist so it's easier to compare the "before" and "after" states for each case.
The code in this project is licensed under the Apache License 2.0.
Copyright 2018 Google LLC
Building an assistant (chatbot) that translates languages, integrated with Slack
If you're trying to do this, you came to the right place!
See this code in action here: https://twitter.com/CodingDoug/status/953031540811825152
Setup
- Create a Firebase project at the Firebase Console
Aggregating Twitter search results and displaying them on a web page in realtime
If you're trying to do this, you came to the right place!
See this code in action here: https://twitter.com/CodingDoug/status/948225623939473413
Setup
These instructions assume that you already have a Firebase project, and you've provisioned Firestore in it.
Uploading images to Cloud Storage via the web and identifying them with Google Cloud Vision API
If you're trying to do this, you came to the right place!
Watch this code work in real time: https://twitter.com/CodingDoug/status/945035556555186176
Setup
These instructions assume that you already have a Firebase project, and billing is enabled. Billing is required to use the Vision API.
Copying Data from a Google Sheet into Firebase Realtime Database in real time via Apps Script
If you're trying to do this, you came to the right place!
Watch this code work in real time: https://twitter.com/CodingDoug/status/942576182276497409
See also this gist for copying in the other direction: https://gist.github.com/CodingDoug/ffc4f050cc489a0280eb7f4cbe36af07
Setup
Copying data from Firebase Realtime Database to a Google Sheet in real time via Cloud Functions
If you're trying to do this, you came to the right place!
Watch this code work in real time: https://twitter.com/CodingDoug/status/940022568089554944
See also this gist for copying in the other direction: https://gist.github.com/CodingDoug/44ad12f4836e79ca9fa11ba5af6955f7