storageRef.child('images/stars.jpg').getDownloadURL().then(function(url) {
// `url` is the download URL for 'images/stars.jpg'
// Replace the firebase URL with ImageKit.io URL-endpoint
url = url.replace("https://firebasestorage.googleapis.com","https://ik.imagekit.io/your_imagekit_id");
// This can be downloaded directly:
var xhr = new XMLHttpRequest();
xhr.responseType = 'blob';
xhr.onload = function(event) {
// Or inserted into an <img> element:
var img = document.getElementById('myimg');
}).catch(function(error) {