1.0.13 • Published 2 years ago

wppmeta v1.0.13

Weekly downloads
-
License
MIT
Repository
github
Last release
2 years ago

wppmeta

Ported in Brazil NPM npm npm

library not official javascript to WhatsApp Cloud API. Repository of wppmeta.

Features supported

  1. Sending messages
  2. Sending Media (images, audio, video and ducuments)
  3. Sending location

Future updates

  1. Sending messages for templates
  2. Sending messages for buttons
  3. Create templates of messages
  4. Update templates of messages
  5. Delete templates of messages

Installing from npm

$ npm install wppmeta

Setting up

Before getting started with the library, you need to go through the steps and gather some information to get the library working properly.

Follow the steps of Facebook Cloud Api for you to get started.

  1. After the steps, collect your TOKEN and TEST WHATSAPP NUMBER

  2. Lastly verify the number you will be using for testing on the To field

Once you're follow the above procedures, now you're ready to start hacking with the Wrapper.

Get Started library WppMeta

Here how you authenticate your application, you need to specofy two things the TOKEN and phone_number_id of your test number

import { WppMeta } from 'wppmeta'

const whatsaApp = WppMeta.config({
  accountId: "YOUR_ACCOUNT_ID",
  phoneId: "YOUR_PHONE_ID",
  token: 'YOUR_TOKEN_AUTHORIZATION_BEARER',
});

Get List of Phones

const phones = await whatsaApp.getPhones()

Register Phone

const success = await whatsaApp.registerPhone({
    phoneId: 'PHONE_ID',
    pin: '6-digit'
})

Send Message type simple text

const response = await whatsaApp.sendText({
  to: 'PHONE',
  body: {
    message: 'MESSAGE',
    useUrl: false
  }
})

Send Message type midia

const response = await whatsaApp.sendMidia({
  to: 'PHONE',
  mediaObjectId: 'MEDIA_ID'
})

Send Message type location

const response = await whatsaApp.sendLocation({
  to: 'PHONE',
  location: {
    address: 'ADDRESS',
    latitude: 'LATITUDE',
    longitude: 'LONGITUDE',
    name: 'NAME_LOCATION'
  }
})

NOTE:

For more info check Notification Payload refernce and Notification Payload Examples

Issues

If you will face any issue with the usage of this package please raise one so as we can quickly fix it as soon as possible;

Contributing

This is an opensource project under MIT License so any one is welcome to contribute from typo, to source code to documentation, JUST FORK IT.

All the credit

  1. Giovani

License

MIT

1.0.13

2 years ago

1.0.12

2 years ago

1.0.11

2 years ago

1.0.10

2 years ago

1.0.9

2 years ago

1.0.7

2 years ago

1.0.6

2 years ago

1.0.5

2 years ago

1.0.4

2 years ago

1.0.3

2 years ago

1.0.2

2 years ago

1.0.1

2 years ago

1.0.0

2 years ago