Socket
Socket
Sign inDemoInstall

fcmlly

Package Overview
Dependencies
50
Maintainers
1
Versions
8
Alerts
File Explorer

Advanced tools

Install Socket

Detect and block malicious and high-risk dependencies

Install

    fcmlly

An integration for Google FCM and Node.js


Version published
Weekly downloads
16
increased by100%
Maintainers
1
Install size
4.12 MB
Created
Weekly downloads
 

Readme

Source

Fcmlly - Integrate with Google cloud messaging easily

Best way to send your push notifications. Thanks to brentclouse for this gif I accept any contributes with open arms \./

Installation


npm i fcmlly

Usage


const Fcmlly = require('fcmlly');
const fcmlly = new Fcmlly('YOUR_APIKEY_HERE'); // Get this key from Firebase console > Settings (page) > Cloud Messaging (tab) > Project credentials (section) > Server Key

Samples


const res = await fcmlly.pushToUser('user fcm token', 'youe title text', 'your body text');
console.log(res);

or

fcmlly.pushToUser('user fcm token', 'youe title text', 'your body text').then((res) => { console.log(res) }).catch((err) => { console.error(err) });



// sample console output:
// {
//  multicast_id: 76468637435051*****,
//  success: 1,
//  failure: 0,
//  canonical_ids: 0,
//  results: [ { message_id: '0:1603183795340265%a5e3d8a7a5e*****' } ]
// }

Methods


  • Push to a user .push('userId', 'title', 'body')

  • Push to all users in a topic .pushToTopic('topic name', 'title', 'body')

  • Subscribe a user to a topic .subscribeToTopic('user FCM token', 'topic name')

Keywords

FAQs

Last updated on 25 Jan 2021

Did you know?

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

Stay in touch

Get open source security insights delivered straight into your inbox.


  • Terms
  • Privacy
  • Security

Made with ⚡️ by Socket Inc