npm package discovery and stats viewer.

Discover Tips

  • General search

    [free text search, go nuts!]

  • Package details

    pkg:[package-name]

  • User packages

    @[username]

Sponsor

Optimize Toolset

I’ve always been into building performant and accessible sites, but lately I’ve been taking it extremely seriously. So much so that I’ve been building a tool to help me optimize and monitor the sites that I build to make sure that I’m making an attempt to offer the best experience to those who visit them. If you’re into performant, accessible and SEO friendly sites, you might like it too! You can check it out at Optimize Toolset.

About

Hi, 👋, I’m Ryan Hefner  and I built this site for me, and you! The goal of this site was to provide an easy way for me to check the stats on my npm packages, both for prioritizing issues and updates, and to give me a little kick in the pants to keep up on stuff.

As I was building it, I realized that I was actually using the tool to build the tool, and figured I might as well put this out there and hopefully others will find it to be a fast and useful way to search and browse npm packages as I have.

If you’re interested in other things I’m working on, follow me on Twitter or check out the open source projects I’ve been publishing on GitHub.

I am also working on a Twitter bot for this site to tweet the most popular, newest, random packages from npm. Please follow that account now and it will start sending out packages soon–ish.

Open Software & Tools

This site wouldn’t be possible without the immense generosity and tireless efforts from the people who make contributions to the world and share their work via open source initiatives. Thank you 🙏

© 2026 – Pkg Stats / Ryan Hefner

fb-messenger-platform

v0.1.5

Published

Simple package to manage messenger platform

Downloads

42

Readme

Build Status Coverage Status code style: prettier

messenger-platform

A NON official node client for Facebook Messenger Platform

Init

Init an instance of Messenger with at least the Facebook token and your verify string

const Messenger = require('messenger');
const messenger = new Messenger({ token: 'your_token', verify: 'your_verify_string'});

Send

Send a message

You can send messages with just text :

messenger.sendMessage('recipient_id', {
  text: 'My first bot message'
}).then(response => console.log(response));

You can send messages with text and attachment (or just attachment):

messenger.sendMessage('recipient_id', {
  text: 'My first bot message',
  attachment: {
    url: 'http://example.com/myimage.png',
    type: 'image'
  }
}).then(response => console.log(response));

You can send messages with text and buttons (what FB call the button template):

const buttons = new Buttons();
buttons.add({
  title: 'My Website',
  url: 'http://mywebsite.com'
});

messenger.sendMessage('recipient_id', {
  text: 'My first bot message',
  buttons: buttons
}).then(response => console.log(response));

Send an action

You can send an action in order to keep your user in touch with what your bot is doing. Possible actions : mark_seen, typing_on, typing_off

messenger.sendAction('recipient_id', 'typing_on').then(response => console.log(response));

Or even more easy for setting if your typing or stop showing the typing indicator :

messenger.setTyping('recipient_id', true).then(response => console.log(response));

Send a Generic Template

More infos about generic template here: https://developers.facebook.com/docs/messenger-platform/send-messages/template/generic

//Init Elements
const elements = new Elements();

//Add at least one element (and max 10)
elements.add({
  title: '', //The title of the element
  subtitle: '', //The subtitle of the element
  image: '' //The url of the image
})

//Send a Generic template
messenger.sendGenericTempalte('recipient_id', elements, {sharable: false, imageRatio: 'square'}).then(response => console.log(response));

Messenger Profile API

More about this api here: https://developers.facebook.com/docs/messenger-platform/reference/messenger-profile-api

Set the Get Started payload

Facebook Doc

messenger.setGetStarted(<PAYLOAD>).then(response => console.log(response));

Set the Greeting text

Facebook Doc

Set the whitelisted domains

Facebook Doc

Set the persistent menu

Facebook Doc

Handover Procotol

More about this part of the API here : https://developers.facebook.com/docs/messenger-platform/reference/handover-protocol

Take the thread

Facebook Doc

Pass the thread

Facebook Doc