Include the Kota.js script on each page you want to run it on - it should always be loaded directly from https://js.kota.io or https://test.js.kota.io, rather than included in a bundle or hosted yourself. This ensures compliance and future updates.
When you are ready to go-live make sure your production environment is not including the test SDK.
Use Kota.Health.Employer(employerAccessToken, options?) to create an instance of the Kota Health’s Employer embedded UI.
The employerAccessToken can be retrieved from the Embed Session endpoint.
Once initialised, if the optional container has not been provided, the employer embed will load in on a <div> with id="employer".
/embed/session endpoint to authenticate the user session.Use Kota.Health.Employee(employeeAccessToken, options?) to create an instance of the Kota Health’s Employee embedded UI.
The employeeAccessToken can be retrieved from the Embed Session endpoint.
Once initialised, if the optional container has not been provided, the employer embedded will load in on a <div> with id="employee".
/embed/session endpoint to authenticate the user session.The only way to communicate with your Embedded UI in the browser is by listening to an event.
You can set up listeners directly from your initialised employer and employee objects or by directly listening for the events on the window.
The pageLoaded event fires each time a new page is loaded throughout an Embedded UI - both for employer and employee.
You can listen for it directly from your initialised objects, e.g. employerEmbed.on('pageLoaded', handler), or with event listeners. If listeningly directly be careful to listen for the correct event as they are namespaced by employer and employee - see the event list for more information.
handler(event) => void is a callback function that you provide that will be called when the event is fired. The healthSetupLoaded event fires each time a new page is loaded throughout an Embedded UI - both for employer and employee.
You can listen for it directly from your initialised objects, e.g. employerEmbed.on('healthSetupLoaded', handler), or with event listeners. If listeningly directly be careful to listen for the correct event as they are namespaced by employer and employee - see the event list for more information.
handler(event) => void is a callback function that you provide that will be called when the event is fired.The healthManagementLoaded event fires each time a new page is loaded throughout an Embedded UI - both for employer and employee.
You can listen for it directly from your initialised objects, e.g. employerEmbed.on('healthManagementLoaded', handler), or with event listeners. If listeningly directly be careful to listen for the correct event as they are namespaced by employer and employee - see the event list below for more information.
handler(event) => void is a callback function that you provide that will be called when the event is fired.The loadError event fires when the Embedded UI fails to load.
You can listen for it directly from your initialised objects, e.g. employerEmbed.on('loadError', handler), or with event listeners. If listeningly directly be careful to listen for the correct event as they are namespaced by employer and employee - see the event list below for more information.
handler(event) => void is a callback function that you provide that will be called when the event is fired.