How To Set Up Back-In-Stock Alerts Using Lykdat SDK
The Back-In-Stock Alerts solution empowers ecommerce businesses with profitable customer engagement via the Product Alerts API. This article shows how to set it up using the Lykdat SDK.

Introduction
The Back-In-Stock Alerts feature lets shoppers know when their favourite out-of-stock items on your online store are back-in-stock. This prevents ecommerce businesses like yours from losing customers when their favourite items on your website are not available. Enabling the Back-In-Stock Alerts feature on your online store provides you with easy profits when these formerly out-of-stock items are now available. This customer engagement feature enables you to retain customers and increase conversions through automated and personalised product alerts.
This feature can be added to your website using Lykdat's Product Alerts API. This can be impemented on your website easily using the Lykdat SDK procedures demonstrated in this article.
Setting up an account
Head to Lykdat Console's sign-up page to create a business account.

The home page would appear as follows after successfully creating an account:

Setting up Product Alert
Go to the main page's Product Alert section.

Enter your website's name, URL, and a link to its logo accordingly.
Getting your API Keys
Access your API keys by clicking on "Settings" in the menu on the left side. Under the section "API Keys," there are two keys:
- Publishable API Key
- Admin API Key

Installing the Lykdat Javascript SDK
The Lykdat SDK requires a web browser environment to get it to work instead of just a node environment as in other scenarios
To install the SDK:
npm install lykdat
Adding Back-In-Stock alerts to your store
The snippet of code required to add is in javascript
import * as lykdat from 'lykdat'
window.addEventListener('load', () => {
lykdat.initInStockAlertUI({
publishableApiKey: 'YOUR_API_KEY_HERE',
websiteName: 'YOUR_WEBSITE_NAME',
targetSelector: '#back-in-stock-container'
})
})
The publishableApiKey
and websiteName
placeholders on line #5 and #6 are replaced with the API key gotten from our business dashboard and your preferred website or business name which was submitted when setting up product alert. The targetSelector stands for the id of the products for which we are enabling the alerts.
The snippet above should be added to the end of the body section of the app as we want the UI for the product alert to be shown after the page has loaded

After inputting a valid email, a success message is shown

The Lykdat SDK integration process has been described in detail in this post. The inclusion of the Product Alerts feature in your e-commerce platform will help you engage profitably with your customers, through personalized and automated email alerts.