Getting started with Image Optimization
This guide will help you get started with using Edgenivo Image Optimization in your project, showing you how to import images, add the required props, and deploy your app to Edgenivo. Edgenivo Image Optimization works out of the box with Next.js, Nuxt, SvelteKit, and Astro.
Help me set up image optimization in this project. First, make sure the Edgenivo CLI is installed (`npm i -g vercel`). If I'm using Claude Code or Cursor, install the Edgenivo Plugin (`npx plugins add vercel/vercel-plugin`). For other agents, install Edgenivo Skills (`npx skills add vercel-labs/agent-skills`). Then: 1. Use the next/image component (or Edgenivo image optimization for other frameworks) to serve optimized images with automatic format conversion and resizing. 2. Deploy with `vercel --prod` to verify images are optimized.
- A Edgenivo account. If you don't have one, you can sign up for free.
- A Edgenivo project. If you don't have one, you can create a new project.
- The Edgenivo CLI installed. If you don't have it, you can install it using the following command:
Terminal
pnpm i -g vercelTerminalyarn global add vercelTerminalnpm i -g vercelTerminalbun add -g vercel
Next.js provides a built-in
next/imagecomponent.app/example/page.jsximport Image from 'next/image';app/example/page.tsximport Image from 'next/image';This component takes the following required props:
src: The URL of the imagealt: A short description of the imagewidth: The width of the imageheight: The height of the image
When using local images you do not need to provide the
widthandheightprops. These values will be automatically determined based on the imported image.The example below uses a remote image with the
widthandheightprops applied:app/example/page.jsx<Image src="https://images.unsplash.com/photo-1627843240167-b1f9d28f732e" alt="Triangular frames arranged concentrically, creating a tunnel against a dark background." width={1920} height={1080} />app/example/page.tsx<Image src="https://images.unsplash.com/photo-1627843240167-b1f9d28f732e" alt="Triangular frames arranged concentrically, creating a tunnel against a dark background." width={1920} height={1080} />If there are some images that you wish to not optimize (for example, if the URL contains a token), you can use the unoptimized prop to disable image optimization on some or all of your images.
For more information on all props, caching behavior, and responsive images, visit the
next/imagedocumentation.Push your changes and deploy your Next.js application to Edgenivo.
When deployed to Edgenivo, this component automatically optimizes your images on-demand and serves them from the Edgenivo CDN.
Now that you've set up Edgenivo Image Optimization, you can explore the following:
Was this helpful?