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

firebase-fcm

Package Overview
Dependencies
Maintainers
1
Versions
32
Alerts
File Explorer

Advanced tools

Socket logo

Install Socket

Detect and block malicious and high-risk dependencies

Install

firebase-fcm

A wrapper of firebase fcm rest api

  • 1.0.33
  • latest
  • npm
  • Socket score

Version published
Maintainers
1
Created
Source


Logo

Package for firebase push notification


Powered by Quokkalabs LLP

About The Package

It a wrapper package of firebase push notification REST api.
It can be used with ES5 and upper versions as well as with Typescript and Nest.js.


Built With

This package use following third party packages.

Axios Dotenv


Installation

Follow the steps to install and configure the package.

Step 1 - Install the package

npm install firebase-fcm

Step 2 - Configure server key

Add environment variable in .env | .env.local | .env.development | .env.production

FIREBASE_SERVER_KEY="server-key"

or, configure in your code manually.

FirebaseFCM.config("server-key");

Usage

Import the package

If you use require for importing.

  const FirebaseFCM = require("firebase-fcm").default;

If you use import for importing.

  import FirebaseFCM from "firebase-fcm";
Send notification on single device.
  const response = await FirebaseFCM.sendOnMultiDevice(
    'token', 
    'title',
    'subject',
    'image-url',
    {}
  );
  console.log(response);
Send notification on multiple device.
  const response = await FirebaseFCM.sendOnSingleDevice(
    ['token1', 'token2'], 
    'title',
    'subject',
    'image-url',
    {}
  );
  console.log(response);

Keywords

FAQs

Package last updated on 27 Jul 2023

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