Skip to content
Docs

Images

Every image CitedSEO makes is one file on https://images.citedseo.ai. The same address can serve it at any of six widths, in the best format the reader’s browser takes (AVIF or WebP), so a card never downloads a full-size picture. Add ?w= and a width (cover.jpg?w=640); imageUrl does that for you.

Images CitedSEO made in the HTML body already have a srcset, sizes for a column up to 800px wide, and loading="lazy". The browser picks the width it needs, and you don’t have to do anything.

The cover is { src, alt } with the full-size address. Pass it through imageUrl and imageSrcset, and give sizes the width the image takes in your layout:

import { imageSrcset, imageUrl } from '@citedseo/feed';
<img
src={imageUrl(article.cover.src, 1280)}
srcSet={imageSrcset(article.cover.src)}
sizes="(min-width: 800px) 800px, 100vw"
alt={article.cover.alt}
/>

For a small card, cap the widths so the list stays short: imageSrcset(article.cover.src, 640).

Function What it does
imageUrl(src, width) The image’s address at a width, rounded up to the nearest of imageWidths.
imageSrcset(src, most?) A srcset with each width up to the one imageUrl gives for most (all of them by default).
imageWidths The widths served: 160, 320, 640, 960, 1280 and 1600 pixels.

Both functions return an address that isn’t from images.citedseo.ai as it is (imageSrcset gives undefined), so they’re safe on any image. An image is never made larger than its file. Every framework package re-exports them.

Keep the full-size cover.src for og:image. The SDKs’ metadata helpers already use it.