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 verified your website in Settings → Website Setup.
								// This is to ensure that guest data is 
								// only sent to verified domains.
                console.log('scheduled', guest);
            });
    };
</script>