Official Whym Frontend Javascript Merchant Plugin
This is the official NPM installation for the Whym Merchant Plugin. Whym Inc. is working on the next generation of Shopper Identity in a world where 3rd-Party Cookies are dead.
Installation
This package is installed traditionally by a simple html script insertion into the website template. However, we have some merchants who have requested an NPM installation path for better management of libraries and dependencies on custom built storefronts.
Traditional HTML Install
This package is installed by most of our merchants through a direct javascript tag insertion into the website theme template. Visit our Support Site for standard instructions on how to install and use this library.
You will need a "seller account id" from the Whym merchant tools for this library to be useful to you. Contact our Sales Team for more details.
A typical installation looks very similar to a Google Analytics or Facebook Pixel intallation:
<!-- START - Whym Merchant Plugin - See whym.tech for more details -->
<script>
(function(e,t,c){e.whymMerchant=e.whymMerchant||{config:c},
(e=t.createElement("script")).async=!0,e.src="https://my.whymwallet.com/tmti-merchant-plugin/{insert-seller-account-id-here}/plugin.js",
(t=t.getElementsByTagName("script")[0]).parentNode.insertBefore(e,t)
})(window,document,{})
</script>
<!-- END - Whym Merchant Plugin - See whym.tech for more details -->
Javascript/Typescript Frontend NPM Installation
Please remember you still need a "seller account id" from the Whym merchant tools for this library to be useful to you. Contact our Sales Team for more details.
Adding the package via NPM is simple:
npm install @whym-inc/merchant-plugin --save
Usage
IMPORTANT - If you install the library via NPM you will need to initialize it somewhere in your code that will trigger the library to initialize and run on EVERY PAGE of your site. Whym focuses on top-of-funnel data and will be severely constrained in utility if the library is not given the ability to monitor top-of-funnel activity of your shoppers.
If you used the traditional html installation method see our Support Site for usage instruction.
If you installed via NPM you will need to initialize the library as demonstrated below:
import whymPlugin from "@whym/merchant-plugin"
// ... your code, classes, react components, etc...
// place this code somewhere it will run ONCE per page load on EVERY page of your site
whymPlugin.initialize('<insert-your-seller-account-id-here>')
// ... yur code, classes, react components, etc...
The initialize command has custom options you can pass to it, but these features are rarely used. Contact your account manager or Whym integrations contact for details about customization options available to your company.
License
MIT
Need Help?
If you have any problems or issues please contact our Support Team for assistance.