Laf is an open-source cloud development platform offering cloud functions, cloud database and storage, so developers can write backend logic in TypeScript/JavaScript without managing servers.
firebase/functions-samples
A collection of sample apps showing common use cases for Cloud Functions for Firebase, in Node.js and Python.
- Stars
- 12,207
- Forks
- 3,821
- Open issues
- 8
- Last commit
- 11 hours ago
What is it?
This repository collects sample code for Cloud Functions for Firebase, a hosted serverless environment where JavaScript or Python code runs in response to events from Firebase services and other triggers. Samples are provided for Node (1st and 2nd gen) and Python (2nd gen), with some in Dart.
The samples are grouped into quickstarts for each trigger type, including Firestore, Realtime Database, HTTPS, Cloud Storage, Auth (including blocking functions), Pub/Sub, Test Lab and Firebase Alerts. Further examples cover image processing with ImageMagick and the Vision API, Realtime Database data consistency patterns, and integrations with services such as Stripe, Slack, Bigquery and the YouTube Data API.
Deploying the samples requires the Firebase Blaze pay-as-you-go billing plan.
Key features
- 01Quickstart samples for Firestore, Realtime Database, HTTPS, Storage, Auth, Pub/Sub and Test Lab triggers
- 02Image processing examples using ImageMagick and the Google Cloud Vision API
- 03Realtime Database patterns for child counts, size limits and automatic cleanup
- 04Third-party integrations such as Stripe, Slack, BigQuery and Google Sheets
- 05Unit testing examples using Jest and Mocha
Use cases
- Learning how to write Cloud Functions triggered by a specific Firebase service
- Starting a new Firebase backend from a working example for auth, storage or database events
- Finding patterns for image processing or third-party API integration inside Firebase projects
Topics
FAQ
- What is functions-samples?
- A collection of sample apps showing common use cases for Cloud Functions for Firebase, in Node.js and Python. This repository collects sample code for Cloud Functions for Firebase, a hosted serverless environment where JavaScript or Python code runs in response to events from Firebase services and other triggers. Samples are provided for Node (1st and 2nd gen) and Python (2nd gen), with some in Dart.
- Is functions-samples free to use? What license does it have?
- functions-samples is open source under the Apache-2.0 license. Check the license terms before using it in commercial products.
- Is functions-samples still maintained?
- Actively maintained. The last commit to functions-samples was on Oct 21, 2026.
- What can I use functions-samples for?
- Learning how to write Cloud Functions triggered by a specific Firebase service Starting a new Firebase backend from a working example for auth, storage or database events Finding patterns for image processing or third-party API integration inside Firebase projects
- Where can I get functions-samples?
- The source code and installation instructions are on GitHub: https://github.com/firebase/functions-samples
Summary generated by AI from the project's README. GitHub stats refresh daily.
Related projects
A set of Flutter plugins that let Flutter apps use Firebase services such as Auth, Firestore, Messaging and Analytics.
Open source Firebase alternative built on PostgreSQL, with an instant GraphQL API, auth, storage and serverless functions.
A lightweight, headless TypeScript ORM for PostgreSQL, MySQL and SQLite that works across Node.js, Bun, Deno and edge runtimes.
A TODO app sample by Google, implemented in several branches to compare Android architecture patterns, tools and testing approaches.
A self-hostable metasearch engine that aggregates results from multiple search services without tracking or profiling users.