Automated image transformation and asset bundling for any Vite-powered project.
Whether you use React, Vue, or Vanilla JS with Vite, we've got you covered.
npm install @imgnodus/imgnodus-react
// Use environmental variables in Vite
const apiKey = import.meta.env.VITE_IMGNODUS_KEY;
async function upload(file) {
const fd = new FormData();
fd.append('file', file);
const res = await fetch('https://api.imgnodus.com/v1/upload', {
method: 'POST',
headers: { 'Authorization': `Bearer ${apiKey}` },
body: fd
});
return await res.json();
}
We're working on automatic layout shift prevention and global state for image loading.