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. 1. Create a new Firebase project 1. Enable email/password authentication 1. Provision Cloud Firestore and apply the rules given in this gist 1. Use the Firebase CLI to create a workspace for Functions using TypeScript 1. Deploy the given HTML and JavaScript to Firebase Hosting (the CLI emulator will also work). 1. Deploy the function code to Cloud Functions using the Firebase CLI 1. Load up the page and create an account. See how it’s able to immediately respond to the new document being created by the deployed auth trigger. [1]: https://medium.com/@CodingDoug/patterns-for-security-with-firebase-offload-client-work-to-cloud-functions-7c420710f07?source=friends_link&sk=35865241b7722504ea2802ae0977c062