Quickstart & reference

Three steps to your first transform.

Point Refract at an existing image origin and drive every transform from the URL. Originals are fetched on demand and edge-cached — never stored permanently.

Quickstart

Run log.

01

Create a key, connect your origin.

Create an API key and point Refract at your existing image origin. No re-upload — originals are fetched on demand.

02

Request your first transform.

Append parameters to any image path and request it straight from the edge.

https://demo.refract.dev/hero.jpg?w=1200&fm=auto&q=80
03

Automate with the SDK.

Build request URLs in code with the JavaScript client.

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

Parameter reference

Ten chainable parameters.

Parameter Accepts Description Value
w
integer, px
Width in pixels.
1200
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 → JPEG.
auto
qNegotiated
1–100
Quality. Default 75.
75
dprNegotiated
1–3
Device pixel ratio.
crop
smart · center · edges
Crop strategy. Smart keeps subjects in frame.
rot
90 · 180 · 270
Rotation, degrees.
blur
0–100
Gaussian blur.
bg
hex color
Background fill for contain.

A dash marks an unset channel. fm, q, and dpr are negotiated from the request's Accept and client headers.

Caching & limits

What the edge holds.

0req/s
Rate limit · per key, all tiers
0days
Transformed variants cached at the edge
Instant
Purge by URL or tag

Point Refract at your origin; originals are fetched on demand and edge-cached up to 30 days, never stored permanently.