Javascript API

Javascript API

Developers can use the CozyCal Javascript API to trigger on certain events.

// Add this code after the CozyCal script tag
<script>
window.onCozyCalLoaded = function (CozyCal) {
    console.log('CozyCal loaded');

    CozyCal
        .on('show', function () {
            console.log('opened');
        })
        .on('hide', function () {
            console.log('hidden');
        })
        .on('scheduled', function (guest) {
            // To receive this event, make sure you
            // have set the domain where you installed CozyCal.
            // This is to ensure that guest data is 
            // only sent to verified domains.
            console.log('scheduled', guest);
        });
};
</script>