API: Manage Visitor Sessions
This API allows you to manage a user session in the Remote Management Server.
In this article
Requirements
- Integration of our JavaScript API into your webpage
- Sample code to run within the app and download for integration into your own project is available here.
- Best practices for working with the JavaScript API are available here.
- App Settings
- Content > JavaScript API > Access JavaScript API = By Import
- Remote Management Server
- Enable Remote Management Server = On
- Site Name, Kiosk Name, & Unit Name = all filled in correctly.
Triggers via API Functions
Add Navigation Event to Current User Session
This function adds a URL and page title to the navigation history for a current user session in the Remote Management Server, allowing you to track events that would not otherwise be reflected in the navigation history (like an AJAX form submission, for example). This navigation event will last until another navigation event occurs or the session is closed.
Format | kp_KioWare_registerNavigation(url, title, callback); |
Parameters |
|
Callback format | callback(success); |
Callback return values | success = if defined, the function successfully triggered and saved an event in the navigation history. |
End Current User Session
This function allows you to manually end a user session in the Remote Management Server without triggering the idle timer or redirecting to the homepage. This may be useful if the project does not use the app's native idle timer (as that is generally what triggers the close of a user session).
Format | kp_KioWare_closeCurrentSession(); |
Sample Code
- This sample code relies on the JavaScript APIs built into Kiosk Pro and will not run successfully in other browsers or within our in-app help interface.
- To run sample code, set the app's homepage to https://kioskgroup.com/rms-session-api
- To download a .zip of sample code, click here.
Change Log
- Added ability to end a visitor session in 7.3 version. Added ability to add a navigation event in 7.6 version.