Repolode
firebase

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