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 🙏

© 2024 – Pkg Stats / Ryan Hefner

gupshup-whatsapp-notifications

v1.1.0

Published

This package is use for gupshup whatsapp notifications.

Downloads

6

Readme

gupshup-whatsapp-notifications

Table of Contents

Overview

With the help of this package you can send whatsApp messages from whatsApp business account to many users.

So follow the instructions and enjoy effortless push notifications on app.

Prerequities

  • Need to create gupshup account in gupshup.
  • Need to create whatsApp business account for live and for sandbox account gupshup provide sender mobile number.

Installation

$ npm install --save gupshup-whatsapp-notifications

Steps

  • create account on gupshup.io.
  • click on whatsapp tab.
  • click on Create App option.

Screenshot from 2023-03-17 15-59-25

  • click on Access API option.

Screenshot from 2023-03-17 16-01-28

  • Insert App name input field and click on submit button.

Screenshot from 2023-03-17 16-02-59

  • Now click on WhatsApp tab. Here you can see your created Apps listing.

Screenshot from 2023-03-17 16-04-52

  • Goto the user profile button and copy the api key.

Screenshot from 2023-03-17 16-10-05

  • Gupshup provide source number(917834811114) for sandbox account. When you go live then you need to create a whatsapp business account.

Screenshot from 2023-03-17 15-26-48.

Create User List For Sending Notifications

  • Click on App Name and goto app detail page.

Screenshot from 2023-03-17 16-45-10

  • Goto Opt-ins section and expand Onboarding mechanisms.
  • Scroll down and scan the QR code for initiating whatsapp chat.

Screenshot from 2023-03-17 16-51-50

  • When we collapse Onboarding mechanisms tab, we can see Opt-in User List. Now we can send message to these specific users only.

Screenshot from 2023-03-17 16-53-10

  • Now come to our package.

After installing package and create an account on gupshup, you need to use whatsappNotifications method and need to pass in parameter.

Eg:

        channel: 'whatsapp',
        receiverNumbers: ["opt-in user1", "opt-in user2"],
        message: 'Hi Devs...',
        senderNumber: `91*******21`,
        appName: 'XYZ',
        gupshupApiKey: 'ycs******************s9kb'
    }
const notificationRes = await whatsappNotifications(notificationInputData);

| Fields | Value | Description | | :---: | :--- | :--- | |channel| whatsapp | Gupshup provide lots of channels like sms, slack, instagram, whatsapp and many more but we use whatsapp | |receiverNumbers| ["<opt-in user1>", "<opt-in user2>"] | Provides opt-ins users mobile number in array as a string. | |message| 'Hi Devs ...' | Here you can pass message which you want to send our users. | |senderNumber| 917834811114 for sandbox account | gupshup provide a sender mobile number for sandbox account when you go live with you **whatsappp App** then you can send message to our users with your own whatsapp business account | |appName| string value | App name which you ctreates on **gupshup whatsapp** acount | |gupshupApiKey` | string value | It is your gupshup API key |

  • The response of this method after successfully execution

Eg: { "status": "submitted", "messageId": "168a9031-cd0b-4ed5-97be-6c333d1b5e39" }

Note:

  • For sandbox account gupshup sends message only one number. If we provide two numbers in an array, api gives success response with messageId and status: submitted but we don't get any message on whatsapp.

Happy Learning...