npm install @cysense-hq/tourjs --save
<script src="https://cdn.jsdelivr.net/npm/@cysense-hq/tourjs/dist/tourjs.js" defer></script>
Copy this HTML code and paste anywhere. Click on this button will start the tour.
<tour-start class="..." api="/Your-Api-Endpoint" id="...">Start the Tour</tour-start>
API here must be publicly available and GET
method.
That's all you need to get started. You can skip following if you stick with the defaults.
function eventhandler(event) {
// Your code goes here
fetch('Your-API-Endpoint').then(response => {
return response.json();
}).then(response => {
globalThis.webtour = new Tourjs(response);
});
}
Warning: variable must be globalThis.webtour
. Because this global variable is used in other custom web components.
Your API must be in the same format.
You does not have an API. No worries. You can create a json file in your project public folder.
and then add this file like api="getting-started-tour.json
See our example api response json file here.