Huge News!Announcing our $40M Series B led by Abstract Ventures.Learn More
Socket
Sign inDemoInstall
Socket

@firebase/functions

Package Overview
Dependencies
Maintainers
3
Versions
3275
Alerts
File Explorer

Advanced tools

Socket logo

Install Socket

Detect and block malicious and high-risk dependencies

Install

@firebase/functions

This is the functions component for the Firebase JS SDK. It has a peer dependency on the [`@firebase/app`](https://npm.im) package on NPM. This package is included by default in the [`firebase`](https://npm.im/firebase) wrapper package.

  • 0.1.0-canary.1f985cf
  • Source
  • npm
  • Socket score

Version published
Maintainers
3
Created

What is @firebase/functions?

The @firebase/functions package is part of the Firebase JavaScript SDK, providing a powerful, secure, and scalable way to call Cloud Functions for Firebase directly from a web or mobile client. It allows developers to trigger backend code without managing servers, which can be written in Node.js and automatically runs in a managed environment on Google Cloud.

What are @firebase/functions's main functionalities?

Calling a Cloud Function

This feature allows you to call a Cloud Function named 'sayHello' from your client-side application. The function takes an object as an argument, in this case, { name: 'Firebase' }, and returns a promise that resolves with the result of the function call.

const functions = require('@firebase/functions');

const sayHello = functions.httpsCallable('sayHello');
sayHello({ name: 'Firebase' }).then(result => {
  console.log(result.data);
});

Handling Errors

This demonstrates how to handle errors when calling a Cloud Function. The error object contains details about what went wrong, which can be used for debugging or displaying an appropriate message to the user.

sayHello({ name: 'Firebase' }).catch(error => {
  const code = error.code;
  const message = error.message;
  const details = error.details;
  // Handle the error
});

Other packages similar to @firebase/functions

FAQs

Package last updated on 06 Apr 2018

Did you know?

Socket

Socket for GitHub automatically highlights issues in each pull request and monitors the health of all your open source dependencies. Discover the contents of your packages and block harmful activity before you install or update your dependencies.

Install

Related posts

SocketSocket SOC 2 Logo

Product

  • Package Alerts
  • Integrations
  • Docs
  • Pricing
  • FAQ
  • Roadmap
  • Changelog

Packages

npm

Stay in touch

Get open source security insights delivered straight into your inbox.


  • Terms
  • Privacy
  • Security

Made with ⚡️ by Socket Inc