mawada-sdk
v1.0.0
Published
<h1>This is an Web SDK Module which houses the code for Event Streaming & Recommendation features.</h1>
Downloads
3
Readme
How To Install & Use
This SDK uploaded on NPM as a package so you need to run this NPM command to install this package in your frontend app :
npm i mawada-sdk
This is a singleton class which contains instance of 2 classes : EventLogging and Recommendation.
The SDKHelper.initializeSDK method must be called inside the root index.js file for initialization.
This is a singleton class which contains a function for event logging : produceMessage(). You can use this function through SDKHelper class instance.
The SDKHelper.instance.eventLogger.produceMessage() method must be called every time an event is to be logged in Kafka.
The complete request payload :
The data: JSONObject? parameter of the logEvent method will be appended in the "eventMeta" json object.
This is a singleton class which contains 2 functions : getProductRecommendations() and getSimilarProducts(). You can use this function through SDKHelper class instance.
The SDKHelper.instance.productRecommendor.getProductRecommendations() method must be called when you want to show user specific recommendations.
The SDKHelper.instance.productRecommendor.getSimilarProducts() method must be called when you want to show similar products of particular product.