Skip to content
Create a WhatsApp url
Branch: master
Clone or download
Fetching latest commit…
Cannot retrieve the latest commit at this time.
Permalink
Type Name Latest commit message Commit time
Failed to load latest commit information.
examples
.eslintrc.js
.gitignore
.travis.yml
LICENSE
README.md
index.js
index.spec.js
package.json
yarn.lock

README.md

WhatsApp url Build Status

Create a Whatsapp url

Install

$ yarn add whatsapp-url

Usage

const whatsappUrl = require('whatsapp-url')

console.log(whatsappUrl({
  phone: '5541984401163',
  text: 'Hello World, its me Mario!'
}))
// https://api.whatsapp.com/send?text=Hello%20World,%20its%20me%20Mario!&phone=5541984401163

console.log(whatsappUrl({
  phone: '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

Demo

Look at a demonstration of how it works here.

API

whatsappUrl([options])

Returns a string

text

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

phone

Type: string
Example: 55984401163


Support

Please open an issue for support.

Contributing

Please contribute using Github Flow. Create a branch, add commits, and open a pull request. Contributing

  1. Fork it!
  2. Create your feature branch: git checkout -b my-new-feature
  3. Commit your changes: git commit -m 'Add some feature'
  4. Push to the branch: git push origin my-new-feature
  5. Submit a pull request :D

History

See Releases for detailed changelog.

Author

twitter/oseunando
Fernando Moreira

Inspired by

bukinoshita/share-twitter - Thank you!

License

WWWWWW||WWWWWW
 W W W||W W W
      ||
    ( OO )__________
     /  |           \
    /o o|    MIT     \
    \___/||_||__||_|| *
         || ||  || ||
        _||_|| _||_||
       (__|__|(__|__|

Code is under MIT License - © Fernando Moreira

Buy me a coffee?

It will encourage me to keep it going, fix whatever bugs you find and spend time making it better :D

Buy me a coffee? - https://www.paypal.me/nandomoreira/5
You can’t perform that action at this time.