Ensure the RivoJS object is loaded by listening to rivo-js-loaded on the document

if (window.RivoJS) {
  // RivoJS is loaded and ready to use
} else {  
  document.addEventListener("rivo-js-loaded", function(){
  // RivoJS is loaded and ready to use
}