I'm trying to trigger an event on my crossrider extension. Using the code below the event never gets to the extension. If I put a timeout and wait 5 seconds it does. So is there a way to detect when the extension\api is ready to receive events?
$(document).ready(function () {
var x = 'xxxxx';
$('body').fireExtensionEvent('eventName', { key: 'token-' + x });
});