whatsapp-url

0.0.4 • Public • Published

WhatsApp url

Create a Whatsapp url

Install

$ yarn add whatsapp-url

Usage

const whatsappUrl = require('whatsapp-url')
 
console.log(whatsappUrl({
  url: '5541984401163',
  text: 'Hello World, its me Mario!'
}))
// https://api.whatsapp.com/send?text=Hello%20World,%20its%20me%20Mario!&phone=5541984401163
 
console.log(whatsappUrl({
  url: '5541984401163',
  text: 'Hello World, its me Luigi!',
  isWeb: true
}))
// https://web.whatsapp.com/send?text=Hello%20World,%20its%20me%20Luigi!&phone=5541984401163

When add the url to a <a/> tag it should work like this

Examples

Check the examples

API

whatsappUrl([options])

Returns a string

text

Type: string
Example: Hello%20World,%20its%20me%20Mario!

phone

Type: string
Example: 55984401163


Inspired by

bukinoshita/share-twitter - Thank you!

License

MIT © Fernando Moreira

Package Sidebar

Install

npm i whatsapp-url

Weekly Downloads

14

Version

0.0.4

License

MIT

Unpacked Size

4.03 kB

Total Files

4

Last publish

Collaborators

  • nandomoreira.me