Browse Source

Update README.md

master
Nicolas Garnier 8 years ago
committed by GitHub
parent
commit
550e18d7de
  1. 137
      README.md

137
README.md

@ -1,14 +1,14 @@
# Firebase SDK for Cloud Functions Samples Library # Cloud Functions for Firebase Sample Library
This repository contains a collection of samples showcasing some typical uses of Cloud Functions using the [Firebase SDK for Cloud Functions](https://firebase.google.com/docs/functions). This repository contains a collection of samples showcasing some typical uses of [Cloud Functions for Firebase](https://firebase.google.com/features/functions).
### What's Cloud Functions? ### What's Cloud Functions for Firebase?
Cloud Functions is a hosted, private, and scalable Node.js environment where you can run JavaScript code. Firebase SDK for Cloud Functions integrates the Firebase platform by letting you write code that responds to events and invokes functionality exposed by other Firebase features. Cloud Functions is a hosted, private, and scalable Node.js environment where you can run JavaScript code. [Cloud Functions for Firebase](https://firebase.google.com/features/functions) integrates the Firebase platform by letting you write code that responds to events and invokes functionality exposed by other Firebase features.
## Prerequisites ## Prerequisites
To learn how to get started with the Firebase SDK for Cloud Functions have a look at our [Getting Started Guide](https://firebase.google.com/docs/functions/get-started), try the [quickstart samples](/quickstarts) and have a look at [the documentation](https://firebase.google.com/docs/functions). To learn how to get started with Cloud Functions for Firebase by having a look at our [Getting Started Guide](https://firebase.google.com/docs/functions/get-started), trying the [quickstart samples](/quickstarts) and looking at [the documentation](https://firebase.google.com/docs/functions).
## Use Cases and Samples ## Use Cases and Samples
@ -34,7 +34,7 @@ This quickstart sample demonstrates using **Cloud Functions** triggered by **Fir
This quickstart sample demonstrates using **Cloud Functions** triggered by **PubSub events**. The functions log the PubSub payload in a Hello world message. 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](/authorized-https-endpoint) ### [Authorized HTTP endpoint](/authorized-https-endpoint)
This samples shows how to restrict an HTTPS Function to only the Firebase users of your app. 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. 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.
@ -66,6 +66,131 @@ Uses an HTTP trigger.
Demonstrates how to authorize with a 3rd party sign-in mechanism (LINE in this case), create a Firebase custom auth token, update the user's profile and authorize Firebase. Demonstrates how to authorize with a 3rd party sign-in mechanism (LINE in this case), create a Firebase custom auth token, update the user's profile and authorize Firebase.
Uses an HTTP trigger. Uses an HTTP trigger.
### [Convert images after upload](/convert-images)
Demonstrates how to automatically convert images that are uploaded to Firebase Storage to JPEG using ImageMagick.
Uses a Firebase Storage trigger.
### [Generate image thumbnails after upload](/generate-thumbnail)
Demonstrates how to automatically generate a thumbnail for images that are uploaded to Firebase Storage.
Uses a Firebase Storage trigger.
### [Post GitHub commits to Slack channel](/github-to-slack)
Demonstrates how to automatically post GitHub commits to a Slack channel using an HTTPS triggered Function.
### [Create and charge Stripe customers](/stripe)
Demonstrates hows to integrate Firebase Auth and the Realtime database with Stripe via the Stripe Node.js library.
### [Moderate offensive images](/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](/exif-images)
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](/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](/email-confirmation)
Sends email confirmation after users subscribed to a mailing list.
Uses an Realtime Database trigger.
### [LastModified Firebase Database tracking](/lastmodified-tracking)
Tracking when the Firebase Database (or a subset) was last modified.
Uses an Realtime Database trigger.
### [Webhook upon Firebase Database writes](/minimal-webhook)
Writing to the Firebase 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](/child-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](/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](/limit-children)
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 into Big Query](/bigquery-import)
Copies Firebase Database elements into BigQuery automatically. This can be useful for instance for further logs analysis.
Uses an Realtime Database trigger.
### [Full-text search via Algolia](/fulltext-search)
Enable full-text search on firebase database elements by using an Algolia hosted search service.
Uses an Realtime Database trigger.
### [User data cleanup](/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.
### [Send a survey when users update your app](/survery-app-updated)
This sample shows how to send a survey to your users who have updated your app. App Update is detected using a Firebase Analytics event.
Uses an Analytics trigger.
### [Send a coupon to user who have completed a purchase](/coupon-on-purchase)
This sample shows how to send a coupon to your users who have just purchased something. 10% off on your next purchase!
Uses an Analytics trigger.
### [Delete inactive users accounts via cron](/delete-unused-accounts-cron)
Periodically deletes the accounts of users who have not signed in the last month.
Uses an HTTPS trigger.
### [Username/password sign in with Firebase](/username-password-auth)
Demonstrates how to authorize with a username/password sign-in mechanism, create a Firebase custom auth token, update the user's profile and authorize Firebase.
Uses an HTTP trigger.
## Contributing
We'd love that you contribute to the project. Before doing so please read our [Contributor guide](CONTRIBUTING.md).
## License
© Google, 2015. Licensed under an [Apache-2](LICENSE) license.
Uses a Realtime Database trigger.
### [Authorize with LinkedIn](/linkedin-auth)
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](/instagram-auth)
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.
### [Authorize with LINE](/line-auth)
Demonstrates how to authorize with a 3rd party sign-in mechanism (LINE in this case), create a Firebase custom auth token, update the user's profile and authorize Firebase.
Uses an HTTP trigger.
### [Automatically Convert Images](/convert-images) ### [Automatically Convert Images](/convert-images)
Demonstrates how to automatically convert images that are uploaded to Firebase Storage to JPEG using ImageMagick. Demonstrates how to automatically convert images that are uploaded to Firebase Storage to JPEG using ImageMagick.

Loading…
Cancel
Save