Docs
Quickstart & reference.
Three steps to your first transform, then the ten parameters that build every URL.
01
Create an API key and connect your image origin.
Point Refract at an image origin you already host. Nothing is re-uploaded: originals are fetched on demand, cached at the edge, and never stored permanently.
02
Request your first transform.
Append parameters to the source path. The edge fetches, transforms, caches, and returns.
https://demo.refract.dev/hero.jpg?w=1200&fm=auto&q=80
03
Automate with the SDK.
Build the same URL from code.
import { refract } from "@refract/js";
const url = refract("hero.jpg", { width: 1200, format: "auto", quality: 80 });
// → https://demo.refract.dev/hero.jpg?w=1200&fm=auto&q=80
Reference
Ten parameters.
| Parameter | Values | Description |
|---|---|---|
| w | integer, px | Width in pixels. |
| h | integer, px | Height in pixels. |
| fit | cover, contain, fill, crop | Resize mode. |
| fmNegotiated | jpeg, png, webp, avif, auto | Output format. auto negotiates AVIF, WebP, or JPEG from the request Accept header. |
| qNegotiated | 1–100, default 75 | Output quality. |
| dprNegotiated | 1–3 | Device pixel ratio. |
| crop | smart, center, edges | Crop strategy. smart keeps the subject in frame. |
| rot | 90, 180, 270 | Rotation in degrees. |
| blur | 0–100 | Gaussian blur. |
| bg | hex color | Background fill for contain. |
Caching & limits
What the edge holds.
Rate limit, all tiers
50 requests / second per key
Transformed variants cached at the edge
30 days
Purge
Instant, by URL or tag