Any way to display all the images I have in cloudinary with javascript?
Hello, I have a website in html and javascript and I would like to show all the images randomly that I have in cloudinary from the api, any way to do it?
I have this code, but I only need to get the images in an array
var arr = [ "http://cloudinary12.png", "http://cloudinary3.png", "http://cloudinary.jpg", ]; getRndImgs = function(o,numberOfImgs){ for(var j, x, i = o.length; i; j = parseInt(Math.random() * i), x = o[--i], o[i] = o[j], o[j] = x); return o.slice(0,numberOfImgs-1); };
-
Official comment
Hi Luis.
Thanks for your question. We do have a Javascript SDK, but due to the exposed nature of frontend code, it's not really designed to pull a list of assets from your account. Its purpose is more for helping to generate transformed versions of existing assets when referenced by name.
You could use a naming convention for your images and then reference those in an array, but really I think the best way of accomplishing this is using a backend SDK such as our Node SDK and then using that to get a list of resources by criteria such as asset tag.
I hope this is helpful. If you have any further questions, you're welcome to reply here or raise a support ticket if you wish to discuss specific account details.
Thanks,
-Danny
Post is closed for comments.
Comments
1 comment