JS SDK
This Javascript SDK is created by Ingrow to using the Ingrow event streaming platform. It provides the functionality of collecting and sending events to the Ingrow system and make insights based on them.
Initialize
After importing SDK, you must initialize it by giving api key
and project id
that you have received from Ingrow panel.
const myIngrow = new ingrow("API_KEY", "PROJECT_ID")
By default the IP of user will attached automatically but You can
overwrite by sending the according IP in your your custom data.
Send Event
After initializing SDK, you can send event using sendEvent()
method. You must pass stream name and custom data to sendEvent method. for example:
myIngrow.sendEvent("STREAM_NAME", {
description: "paginate",
event_type: "Click",
element_type: "Button",
time: new Date(),
})
sendEvent
method will return a promise, so you can handle success or failure of event sending like other promises.
Configurations
By default the event endpoint is Ingrow's event listener endpoint. In the case of on-premises deployment, you can set an environment variable named LUNGO_ENDPOINT
to change this address.