vanilla-whatsapp

1.0.6 • Public • Published

vanilla-whatsapp

A simple whatsapp chat clone plugin code in vanilla javascript

vanilla-whatsapp cover

Table of contents

Installation & Usage

npm i vanilla-whatsapp
  1. Import the plugin: add a script tag pointing to vanilla-whatsapp.js
<html>
    <head>
    <link rel="stylesheet" href="<path-to-vanilla-whatsapp.css>">
    <script defer src="<path-to-vanilla-whatsapp.js>"></script>
    </head>
    <body>
        <!-- body content -->    
    </body>
</html>
  1. Run the plugin
window.initVanillaWhatsapp();

Customization

const whatsappData = {
  phoneNumber: "3432132132",
  positionButtonWhatsapp: {
    top: "",
    right: "15%",
    bottom: "2%",
    left: "",
  },
  images: {
    pathUserLogo: "",
  },
  replaceText: {
    header: {
      userName: "User name",
      slogan: "Usually responds the same day",
    },
    bodyChat: {
      messageOne: "Hello 👋",
      messageTwo: "How can I help you?",
    },
    linkToWhatsappButtonText: "Send message",
  },
};
window.initVanillaWhatsapp(whatsappData);

Note: phone number must be preceded by the country prefix in the default option is 34 the prefix of Spain

Vanilla-whatsapp in React

https://codesandbox.io/s/vanilla-whatsapp-react-35gtww?file=/src/App.js


"Buy Me A Coffee"

/vanilla-whatsapp/

    Package Sidebar

    Install

    npm i vanilla-whatsapp

    Weekly Downloads

    1

    Version

    1.0.6

    License

    ISC

    Unpacked Size

    425 kB

    Total Files

    4

    Last publish

    Collaborators

    • charls96