GithubHelp home page GithubHelp logo

iamraafay / functions-samples Goto Github PK

View Code? Open in Web Editor NEW

This project forked from firebase/functions-samples

0.0 1.0 0.0 555 KB

Collection of sample apps showcasing popular use cases using Cloud Functions for Firebase

Home Page: https://firebase.google.com/docs/functions

License: Apache License 2.0

JavaScript 55.42% HTML 22.29% CSS 6.92% Java 6.92% Objective-C 8.32% Ruby 0.13%

functions-samples's Introduction

Cloud Functions for Firebase Sample Library

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

What's Cloud Functions for Firebase?

Cloud Functions is a hosted, private, and scalable Node.js environment where you can run JavaScript code. Cloud Functions for Firebase integrates the Firebase platform by letting you write code that responds to events and invokes functionality exposed by other Firebase features.

Prerequisites

To learn how to get started with Cloud Functions for Firebase by having a look at our Getting Started Guide, trying the quickstart samples and looking at the documentation.

Use Cases and Samples

This repository contains the following samples:

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

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

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

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 are deleted.

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

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.

This sample shows how to create an action for the Google Home/Assistant using the Actions SDK hosted on Cloud Functions. The sample action asks users to say a number and reads out the ordinal of that number. Uses an HTTP trigger.

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.

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.

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.

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.

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

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

Demonstrates how to automatically post GitHub commits to a Slack channel using an HTTPS triggered Function.

Demonstrates hows to integrate Firebase Auth and the Realtime database with Stripe via the Stripe Node.js library.

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.

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

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.

Sends email confirmation after users subscribed to a mailing list. Uses an Realtime Database trigger.

Tracking when the Firebase Database (or a subset) was last modified. Uses an Realtime Database trigger.

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.

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.

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.

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.

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.

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

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.

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.

Periodically deletes the accounts of users who have not signed in the last month. Uses an HTTPS trigger.

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.

License

© Google, 2015. Licensed under an Apache-2 license. Uses a Realtime Database trigger.

functions-samples's People

Contributors

nicolasgarnier avatar jamesdaniels avatar beaspider avatar khanhlvg avatar ulydev avatar mrp14 avatar ryanpbrewster avatar trekforever avatar ooooooo-q avatar idanb11 avatar rldaulton avatar ahsankhatri avatar prescottprue avatar egilmorez avatar tomoya0x00 avatar inlined avatar meghab avatar awesome avatar sean-nicholas avatar romangurovich avatar mustafababil avatar morganchen12 avatar markgoho avatar lukeschlangen avatar justweb1 avatar julienbourdeau avatar dzello avatar jdsingh avatar jpwilliams avatar puf avatar

Watchers

James Cloos avatar

Recommend Projects

  • React photo React

    A declarative, efficient, and flexible JavaScript library for building user interfaces.

  • Vue.js photo Vue.js

    🖖 Vue.js is a progressive, incrementally-adoptable JavaScript framework for building UI on the web.

  • Typescript photo Typescript

    TypeScript is a superset of JavaScript that compiles to clean JavaScript output.

  • TensorFlow photo TensorFlow

    An Open Source Machine Learning Framework for Everyone

  • Django photo Django

    The Web framework for perfectionists with deadlines.

  • D3 photo D3

    Bring data to life with SVG, Canvas and HTML. 📊📈🎉

Recommend Topics

  • javascript

    JavaScript (JS) is a lightweight interpreted programming language with first-class functions.

  • web

    Some thing interesting about web. New door for the world.

  • server

    A server is a program made to process requests and deliver data to clients.

  • Machine learning

    Machine learning is a way of modeling and interpreting data that allows a piece of software to respond intelligently.

  • Game

    Some thing interesting about game, make everyone happy.

Recommend Org

  • Facebook photo Facebook

    We are working to build community through open source technology. NB: members must have two-factor auth.

  • Microsoft photo Microsoft

    Open source projects and samples from Microsoft.

  • Google photo Google

    Google ❤️ Open Source for everyone.

  • D3 photo D3

    Data-Driven Documents codes.