Skip to content

firebase/firebase-functions

master
Switch branches/tags

Name already in use

A tag already exists with the provided branch name. Many Git commands accept both tag and branch names, so creating this branch may cause unexpected behavior. Are you sure you want to create this branch?
Code

Latest commit

* Upgrade jsonwebtoken to version 9

Upgrading jsonwebtoken to version 9.0.0 or higher.

* Update changelog
21f4dcb

Git stats

Files

Permalink
Failed to load latest commit information.
Type
Name
Latest commit message
Commit time
Mar 3, 2017

Firebase SDK for Cloud Functions

The firebase-functions package provides an SDK for defining Cloud Functions for Firebase.

Cloud Functions is a hosted, private, and scalable Node.js environment where you can run JavaScript code. The 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.

Learn more

Learn more about the Firebase SDK for Cloud Functions in the Firebase documentation or check out our samples.

Here are some resources to get help:

If the official documentation doesn't help, try asking through our official support channels: https://firebase.google.com/support/

Please avoid double posting across multiple channels!

Usage

// functions/index.js
const functions = require("firebase-functions");
const notifyUsers = require("./notify-users");

exports.newPost = functions.database.ref("/posts/{postId}").onCreate((snapshot, context) => {
  functions.logger.info("Received new post with ID:", context.params.postId);
  return notifyUsers(snapshot.val());
});

Contributing

To contribute a change, check out the contributing guide.

License

© Google, 2017. Licensed under The MIT License.