npm package discovery and stats viewer.

Discover Tips

  • General search

    [free text search, go nuts!]

  • Package details

    pkg:[package-name]

  • User packages

    @[username]

Sponsor

Optimize Toolset

I’ve always been into building performant and accessible sites, but lately I’ve been taking it extremely seriously. So much so that I’ve been building a tool to help me optimize and monitor the sites that I build to make sure that I’m making an attempt to offer the best experience to those who visit them. If you’re into performant, accessible and SEO friendly sites, you might like it too! You can check it out at Optimize Toolset.

About

Hi, 👋, I’m Ryan Hefner  and I built this site for me, and you! The goal of this site was to provide an easy way for me to check the stats on my npm packages, both for prioritizing issues and updates, and to give me a little kick in the pants to keep up on stuff.

As I was building it, I realized that I was actually using the tool to build the tool, and figured I might as well put this out there and hopefully others will find it to be a fast and useful way to search and browse npm packages as I have.

If you’re interested in other things I’m working on, follow me on Twitter or check out the open source projects I’ve been publishing on GitHub.

I am also working on a Twitter bot for this site to tweet the most popular, newest, random packages from npm. Please follow that account now and it will start sending out packages soon–ish.

Open Software & Tools

This site wouldn’t be possible without the immense generosity and tireless efforts from the people who make contributions to the world and share their work via open source initiatives. Thank you 🙏

© 2024 – Pkg Stats / Ryan Hefner

multibuttonengagement

v2.0.2

Published

Customizable multi-button engagement for LivePerson's Conversational Cloud

Downloads

5

Readme

Multi Button Engagement

Customizable multi-button engagement for LivePerson's Conversational Cloud platform.

Note: This code repository is not supported, use at your own risk.

Setup

Engagement

Add an engagement with the "Embedded" set as the format, and then cloose "HTML Engagement"

Embedded

html

Enter this code:

<div id="lp-multi-channel-engagement" data-LP-event="click"></div>

Generate the code for the page here, note/copy the <div> code provided, and then finish creating the engagement.

html

Website

Javascript

Using a tag manager, or direct insertion, load the multi-engagement.min.js file on your website. You can optionally use the CDN link here

https://cdn.jsdelivr.net/gh/LivePersonNY/MultiButtonEngagement/multi-engagement.min.js

Page element

Paste in the footer of your page the div noted from the engagement

<div id="LP_DIV_XXXXXXXXX"></div>

Custom Configuration

The settings of the engagement can be configured in 2 ways. Using data attributes in the <div id="lp-multi... added to the engagement, or by calling the config method on the lpMultiChannelEngagement object (created when js is loaded).

Using data attributes

For instance, to tell the engagement which channels you want to appear, override the "channels" data setting:

<div data-channels="sms,whatsapp" id="lp-multi-channel-engagement" data-LP-event="click"></div>

To do in JS on page, use this example:

<script src="/path/to/javascript.js"></script>
<script>
	lpMultiChannelEngagement.config({
		channels: "sms,whatsapp" //Choices are sms, whatsapp, apple, facebook
	});
</script>

Options

Below is a table of the available options and defaults

Settings

|Option|Description|Default| |---|---|---| |imagemain|URL, Sets the primary enagement image.|chat| |imagefacebook|URL, Sets the facebook button image.|facebook| |imagewhatsapp|URL, Sets the whatsapp button image.|whatsapp| |imageapple|URL, Sets the apple business chat button image.|whatsapp| |imagesms|URL, Sets the sms button image.|whatsapp| |channels|String, Sets the channels that will appear in the engagement|facebook,whatsapp,apple,sms| |containerclass|String, the CSS class that is applied to the wrapping DIV for styling purposes|lp-multi-channel-engagement| |zindex|Integer, Sets the Z index of the element, typically this will not need to be changed|10000| |css|URL, The url to the CSS file that is loaded for styling. Use this if you want to dramatically change the look/feel of the engagement|Default CSS...| |debug|Boolean, enable debug logs to appear in the console|false|

Callbacks

Note: It is recommended to call these methods in JS rather than setting the callbacks in data attributes.

Available callback methods for this are: onClickWhatsapp, onClickFacebook, onClickApple, and onClickSms

Example:

<script>
	lpMultiChannelEngagement.config({
		channels: 'facebook,whatsapp',
		onClickWhatsapp: function() {
			// Do something here like open a whatsapp page
		},
		onClickFacebook: function() {
			// Do something here like open Facebook
		}
	});
</script>

Extra

Start web conversation with initial message from user

There is a method in this Javascript kit that will allow you to fire off an initial message to start a conversation. The method is startWebWithMessage.

<script>
	lpMultiChannelEngagement.startWebWithMessage('Hi there!');
</script>