You can not select more than 25 topics Topics must start with a letter or number, can include dashes ('-') and can be up to 35 characters long.
 
 
 
 
 
 
Lauren Long 0e032649c8 Add unit tests for makeUppercase and sendMessage. 8 years ago
authorized-https-endpoint Add Authorized HTTPS endpoint sample 8 years ago
bigquery-import Updating remaning samples to 0.5.0 8 years ago
child-count Updating remaning samples to 0.5.0 8 years ago
convert-images Updating remaning samples to 0.5.0 8 years ago
delete-unused-accounts-cron Updating remaning samples to 0.5.0 8 years ago
email-confirmation Polishing the email-confirmation sample 8 years ago
exif-images update exif-images README 8 years ago
fcm-notifications typos fixes 8 years ago
fulltext-search Updating remaning samples to 0.5.0 8 years ago
generate-thumbnail Forgot to move to 0.5.0 one sample 8 years ago
instagram-auth change config vars to lowercase and minor polish to readmes 8 years ago
lastmodified-tracking Updating remaning samples to 0.5.0 8 years ago
limit-children Updating remaning samples to 0.5.0 8 years ago
linkedin-auth change config vars to lowercase and minor polish to readmes 8 years ago
message-translation Updating remaning samples to 0.5.0 8 years ago
minimal-webhook Updating remaning samples to 0.5.0 8 years ago
moderate-images Clean up README 8 years ago
quickstarts Add unit tests for makeUppercase and sendMessage. 8 years ago
text-moderation Updating remaning samples to 0.5.0 8 years ago
user-data-cleanup Updating remaning samples to 0.5.0 8 years ago
.gitignore Cleaned up the email-confirmation sample. 8 years ago
CONTRIBUTING.md Updated Contributing guide. 9 years ago
LICENSE Adding initial README, license files and CONTRIBUTING rules. 9 years ago
README.md Fix PubSub trigger quickstart link 8 years ago

README.md

Firebase SDK for Cloud Functions Samples Library

This repository contains a collection of samples showcasing some typical uses of Cloud Functions using the Firebase SDK for Cloud Functions.

Prerequisites

To learn how to get started with the Firebase SDK for Cloud Functions try the quickstart samples and have a look at the documentation.

Use Cases and Samples

This repository contains the following samples:

Realtime database trigger quickstart: Uppercaser

This quickstart sample demonstrates using Cloud Functions triggered by Firebase Realtime Database events. The function uppercase messages written to the datastore.

HTTPS trigger quickstart: Time Server

This quickstart sample demonstrates using Cloud Functions triggered by HTTPS requests. The function returns the current server time and allows for date time formatting.

Cloud Storage trigger quickstart: Thumbnail generator

This quickstart sample demonstrates using Cloud Functions triggered by Firebase Storage events. The function generates a thumbnail of uploaded images.

Auth trigger quickstart: Welcome Email

This quickstart sample demonstrates using Cloud Functions triggered by Firebase Auth events. The functions sends a Welcome email when user accounts are created (or when users signs-in using an Identity Provider for the first time) and sends a Goodbye email when user accounts ares deleted.

PubSub trigger quickstart: Hello World

This quickstart sample demonstrates using Cloud Functions triggered by PubSub events. The functions log the PubSub payload in a Hello world message.

Authorized HTTP Endpoint

This samples shows how to restrict an HTTPS Function to only the Firebase users of your app. Only users who pass a valid Firebase ID token as a Bearer token in the Authorization header of the HTTP request are authorized to use the function. Checking the ID token is done with an ExpressJs middleware that also passes the decoded ID token in the Express request object.

Uses an HTTP trigger.

Send FCM notifications

This sample demonstrates how to send a Firebase Cloud Messaging (FCM) notification from a Realtime Database triggered Function when users get new followers. The sample also features a Web UI to experience the FCM notification.

Uses a Realtime Database trigger.

Authorize with LinkedIn

Demonstrates how to authorize with a 3rd party sign-in mechanism (LinkedIn in this case), create a Firebase custom auth token, update the user's profile and authorize Firebase.

Uses an HTTP trigger.

Authorize with Instagram

Demonstrates how to authorize with a 3rd party sign-in mechanism (Instagram in this case), create a Firebase custom auth token, update the user's profile and authorize Firebase.

Uses an HTTP trigger.

Automatically Convert Images

Demonstrates how to automatically convert images that are uploaded to Firebase Storage to JPEG using ImageMagick.

Uses a Firebase Storage trigger.

Automatically Generate Thumbnails

Demonstrates how to automatically generate a thumbnail for images that are uploaded to Firebase Storage.

Uses a Firebase Storage trigger.

Automatically Moderate Images

Demonstrates how to automatically moderate offensive images that are uploaded to Firebase Storage by using the Google Cloud Vision API to detect offensive images and ImageMagick to blur these images.

Uses a Firebase Storage trigger.

Extract Image Metadata

Demonstrates how to automatically extract image's metadata using ImageMagick for images that are uploaded to Firebase Storage.

Uses a Firebase Storage trigger.

Text Moderation

How to moderate user input text for bad words. For example this can be used to moderate usernames, chat or forum messages.

Uses an Realtime Database trigger.

Email Confirmation

Sends email confirmation after users subscribed to a mailing list.

Uses an Realtime Database trigger.

LastModified Firebase Database tracking

Tracking when the Firebase Database (or a subset) was last modified.

Uses an Realtime Database trigger.

Webhook upon Database writes

Writing to the Database triggers a request to a callback URL (a Webhook). The content of the modified Data is sent to the Webhook.

Uses an Realtime Database trigger.

Firebase Database Child Nodes Count

Keeps track of the number of child nodes of a Firebase Database element allowing clients to filter or order results using the child count. This can be useful to keep tack of the number of "likes" or "followers" of a somethings shares through social media.

Uses an Realtime Database trigger.

Automatic message translation

Integrates the Google Translate API to perform automatic text translation across any number of languages. Language codes can be stored in Firebase for on the fly changes.

Uses an Realtime Database trigger.

Limit number of child nodes

Make sure to keep the number of child nodes below a certain threshold. For instance this can be useful to limit the number of lines of logs or chat history below a given number.

Uses an Realtime Database trigger.

Import Data to Big Query

Copies Firebase Database elements into BigQuery automatically. This can be useful for instance for further logs analysis.

Uses an Realtime Database trigger.

Enable full-text search on firebase database elements by using an Algolia hosted search service.

Uses an Realtime Database trigger.

User Data Cleanup

Deletes all associated user data that's on the Realtime database when a user deletes his Firebase account.

Uses an Auth trigger.

Delete Inactive Users Accounts Cron

Periodically deletes the accounts of users who have not signed in the last month.

Uses an HTTPS trigger.

Contributing

We'd love that you contribute to the project. Before doing so please read our Contributor guide.

License

© Google, 2015. Licensed under an Apache-2 license.