The LiveLike Engagement SDK allows integrators to enhance their web video experiences with chat, interactive widgets, and other features to increase user engagement.
Installing
The Engagment SDK can be installed with npm or Yarn. For more details see the NPM package.
npm i @livelike/engagementsdk
Initialize the SDK with the LiveLike.init
function. A Client IDClient ID - A string value that uniquely identifies an Application. in the clientId
parameter is required to initialization to succeed.
Make sure you have a valid Client ID
You'll need a Client ID for this step, which you learn how to do in Retrieving Important Keys.
import LiveLike from "@livelike/engagementsdk";
import { clientId } from './your-config'
LiveLike.init({ clientId }).then(profile => {
// This will generate a new profile
console.log("LiveLike is connected!")
});
User Profile Integration
The init function will create a new LiveLike profile and access token by default, and each profile created counts toward a monthly active user count. You should re-use the access tokens when you can to treat returning visitors as the same user. To better integrate this into your own product and more accurately reflect your MAUs, check out the User Profile Integration section.
UMD Builds
You can also use the UMD build if you would like to use the Engagement SDK in the browser without a module context:
<html>
<body>
<script src="https://unpkg.com/@livelike/engagementsdk/livelike.umd.js"></script>
<script src="https://cdn.polyfill.io/v2/polyfill.min.js"></script> <!-- For Internet Explorer compatibility -->
<livelike-widgets programid="xyz"></livelike-widgets>
<livelike-chat></livelike-chat>
<script>
LiveLike.init({
clientId: "your-client-id",
});
</script>
</body>
</html>
Updated 5 months ago