Setup
To use the API, simply include the script in the <head> of your Gurapp's HTML file.
<head>
<!-- Your other meta tags, links, etc. -->
<script src="https://polygol.github.io/assets/gurapp/api/gurasuraisu-api.js"></script>
<script src="your-app.js" defer></script>
</head>Waiting for the API to be Ready
The API script needs a moment to initialize. To ensure the Gurasuraisu object is available before you use it, listen for the GurasuraisuReady event on the window object. This is the recommended entry point for your application's logic.
Example: your-app.js
window.addEventListener('GurasuraisuReady', () => {
// The Gurasuraisu API is now ready to use.
console.log('My Gurapp is ready!');
initializeApp();
});
function initializeApp() {
// Your app's main logic goes here.
const myButton = document.getElementById('my-button');
myButton.addEventListener('click', () => {
Gurasuraisu.showPopup('Button clicked!');
});
}Last updated