@convertly-sh/image, wire it into your framework, and verify the result.
Every CDN URL needs a CDN endpoint plus either an origin source or a storage file UUID/slug. The SDK rewrites URLs; Convertly still fetches the source from your deployed site or storage.
You have two source options:
- Source URLs / origin sources: images that already live behind a public HTTPS URL. This includes deployed framework app public/static assets, plus public S3/R2/GCS/Azure bucket endpoints, custom CDN domains, and web folders. Convertly fetches these deployed URLs on demand; it does not read local project folders.
- Convertly Storage: images uploaded to Convertly when you want managed files and file IDs.
1
Use your CDN endpoint
A CDN endpoint is the durable delivery identity in CDN URLs. Its URL namespace is safe to embed in HTML and ship to the browser because it is not a credential.Go to Image CDN → Delivery and copy your default endpoint, or create a site-specific endpoint with a URL namespace such as
marketing or site. URL signing keys are only needed when the endpoint requires signed URLs or a protected transform requires a signature.2
Choose a source
The CDN can optimize either a source URL from a configured public HTTPS origin or a file in Convertly Storage. Pick the source that matches where your images already live.
- Repo public/static images: deploy your site, then point an origin source at that public site URL. If
public/hero.jpg,static/hero.jpg, or another framework-served asset resolves ashttps://example.com/hero.jpg, Convertly can fetch that deployed URL and optimize it as/cdn/v1/{endpointNamespace}/o/site/hero.jpg. - Remote assets: point an origin source at an existing public HTTPS bucket, CDN, or web folder, such as
https://assets.example.com. - Convertly Storage: upload or import files to Convertly and use their generated CDN slugs or file IDs, such as
/cdn/v1/{endpointNamespace}/{fileIdOrSlug}.
3
Attach an origin source
Required for repo / bucket / external-host images. Skip this step only if every image uses Convertly Storage UUIDs.If your assets already live on HTTPS or a public bucket, go to Image CDN → Sources and add a source.Public HTTPS — bucket, CDN, or deployed site with a public read URL:For framework repo assets, use the deployed app URL:
- Name:
Site public assets - Slug:
site - Access: Public HTTPS
- Base URL:
https://example.com - Path prefix: leave blank
- Choose your provider and select Private bucket
- Enter bucket name, region/account details, and read credentials
- Convertly encrypts credentials at rest; they are never shown again after save
site origin, these paths map directly:For an asset bucket or existing CDN, use the same pattern with your asset host:
- Slug: a short URL-safe name, e.g.
products. - Base URL: the public HTTPS origin, e.g.
https://assets.example.com. - Path prefix: optional folder prefix, e.g.
catalog.
/cdn/v1/{endpointNamespace}/o/{originSlug}/{path}:4
Use Convertly Storage instead
If you want Convertly to host and manage the source image, upload it to Convertly Storage instead of creating an origin source.
- Manual upload: open the Files tab in the dashboard and drag-and-drop. The file’s id (UUID) is shown in the details panel; the menu has a Copy file ID shortcut.
- Programmatic upload:
POST /api/uploadsfrom your backend with the file bytes; the response includes the file id. - WordPress media: install the Convertly WordPress plugin so media library files sync automatically.
https://cdn.convertly.sh/{endpointNamespace}/{fileIdOrSlug}?w=1200&format=auto. New uploads get readable CDN slugs automatically and UUID URLs keep working. Origin-backed images use https://cdn.convertly.sh/{endpointNamespace}/o/{originSlug}/{path}?w=1200&format=auto.5
Install the SDK
Do this after your CDN endpoint exists and your source is configured (origin source or Convertly Storage upload).The package ships React, Next.js, Vue, Astro, Solid, and Svelte adapters. Pick the one that matches your stack.
6
Wire it into your framework
Choose your path:All adapters default to
- Next.js
- React
- Vue
- Astro
- Plain HTML
Set it once globally so every existing Add
<Image> in your app routes through Convertly with no per-component changes.lib/convertly-loader.ts
next.config.ts
NEXT_PUBLIC_CONVERTLY_CDN_NAMESPACE=assets-acme to your .env.local. Create site as an origin source for your deployed app’s public HTTPS URL. In production, <Image src="/hero.jpg" width={1200} /> is rewritten to a Convertly URL for the deployed public asset: /cdn/v1/{endpointNamespace}/o/site/hero.jpg?w=1200.... During next dev, localPassthrough renders /hero.jpg directly because the public CDN cannot fetch localhost; use a preview deployment or HTTPS tunnel when you want to test the real optimized CDN URL before launch.format=auto (AVIF/WebP/JPEG negotiation), gravity=auto (smart cropping), q=auto (content-aware quality), and loading="lazy". You can override any of them per call.7
Verify it's working
Load a deployed page that renders one of your CDN-backed images. In the browser DevTools Network tab, look for a request to
convertly.sh/cdn/v1/.... If you are using localPassthrough in next dev, localhost will show the original /hero.jpg path; that is expected and is not the optimized CDN path because Convertly cannot fetch local project files. The deployed or tunneled page response should:- Be 200 OK
- Have
Content-Type: image/webp(orimage/avifif your browser supports it) - Have
Cache-Control: public, max-age=31536000, immutable, stale-while-revalidate=86400 - Have an
X-Convertly-CDN-Used-Monthheader showing your delivery counter (first requests that reach Convertly for that URL variant)
disk cache or memory cache in DevTools — no second network request.8
(Optional) Add design-system presets
If you find yourself writing the same transform many times — say, every hero is 1920×720 — save it as a named preset and reference it by name:Now any URL with
?preset=hero (or path /p/hero) gets those defaults. Override individual params on a per-URL basis when you need to — e.g. ?preset=hero&w=800.You can also manage presets visually in Settings → Image CDN → Transform presets.What happens on the first request
When a browser fetches a CDN URL for the first time:- The request hits Convertly’s edge cache. On a miss, Convertly loads the source (storage file, origin URL, or private bucket object).
- Convertly applies the requested transforms (resize, format, smart crop, quality).
- The result is cached with long-lived immutable headers. Popular variants are retained so repeat requests — including from other regions — often skip re-encoding.
Video clips and poster frames
Stored video files use the same CDN endpoint and SDK. Add poster or transcode params to the URL; no separate video package is required:Troubleshooting
Next steps
Use your own hostname
Serve from
cdn.yourdomain.com instead of cdn.convertly.sh. One CNAME — we handle SSL.Every URL parameter
Width, height, quality, fit, gravity, format, text overlay, save-data quality.
Presets and signed URLs
Named transformation bundles and HMAC-signed URLs for gated content.
Delivery, purging, security
Manage CDN endpoints and URL signing keys, invalidate cached URLs, replace files.
Framework SDK reference
Full prop tables for React, Next.js, Vue, Astro, Solid, and Svelte.