Docs

Install and migrate images in minutes

Replace one URL to start serving optimized images. No CDN configuration, no image pipelines, no format tuning.

The @prodkit/react package wraps the URL API in an Image component with automatic srcset, lazy loading, and format negotiation. Works with Vite, CRA, Remix, or any React setup.

Install and configure

Install the package, then wrap your app in ProdKitProvider with your project slug from the dashboard. Every Image below it resolves paths against your endpoint.

Example

pnpm add @prodkit/react

import { ProdKitProvider } from "@prodkit/react"

createRoot(document.getElementById("root")!).render(
  <ProdKitProvider project="acme">
    <App />
  </ProdKitProvider>,
)

Render an image

Pass props instead of query parameters. The component generates srcset variants, sets loading="lazy" by default, and reserves layout space from width and height.

Example

import { Image } from "@prodkit/react"

export function Avatar({ avatar }: { avatar: string }) {
  return <Image src={avatar} width={128} height={128} alt="Avatar" />
}

Migrate existing Supabase URLs

Image accepts full Supabase Storage URLs and rewrites them to your ProdKit endpoint, so you can migrate one component at a time.

Example

<Image
  src="https://xyz.supabase.co/storage/v1/object/public/avatars/cory.png"
  width={128}
  height={128}
  alt="Avatar"
/>

Reference

Image props

Every prop except src, project, and width is optional. buildImageUrl and buildSrcSet are available for custom components.

ParameterDescriptionValuesDefault
srcImage path within your project, or a full Supabase Storage URL to rewrite.stringRequired
projectProject slug from the dashboard. Can be passed through ProdKitProvider.stringRequired
imageBaseUrlCustom image service base URL for self-hosted or preview environments.absolute URLhttps://img.prodkit.cloud
widthRendered width in CSS pixels. Also caps the generated srcset variants.1-4096Required
heightRendered height in CSS pixels.1-4096Auto from aspect ratio
qualityCompression quality.1-10082
fitHow the image fills the requested dimensions.scale-down, contain, cover, crop, padscale-down
formatOutput format. auto negotiates AVIF or WebP per browser.auto, avif, webp, jpeg, pngauto

Claude Code integration

Agent migration checklist

A guided migration should feel like a small code review.

Detect Supabase

Install SDK

Rewrite image URLs

Create a commit