URL Structure
Complete reference for constructing imgfast CDN URLs.
link
Base URL
https://cdn.imgfast.io/{public_key}/{image_path}?{parameters}cdn.imgfast.ioOur global CDN endpoint. All image requests go through this domain.
folder
Path Components
| Component | Required | Description |
|---|---|---|
{public_key} | Yes | Your account's public key (imgfast_pk_xxx) |
{image_path} | Yes | Path to your uploaded image file |
# Simple path
https://cdn.imgfast.io/pk_abc123/photo.jpg
# Nested path
https://cdn.imgfast.io/pk_abc123/products/2024/sneaker-01.jpg
# With transformations
https://cdn.imgfast.io/pk_abc123/hero-banner.jpg?w=1920&f=webptune
Query Parameters
Transformations are applied via query parameters. Multiple parameters are joined with &.
| Category | Parameters | Link |
|---|---|---|
| Size | w, h, fit, g, ar, dpr | Resizing → |
| Format | f, q | Format → |
| Effects | blur, sharpen, brightness, contrast, saturation | Filters → |
| Watermark | wm_text, wm_image, wm_position | Watermark → |
| Security | sig, exp | Signed URLs ↓ |
public
Remote URL Proxy
Transform images from any URL without uploading. Add url/ before the remote URL.
https://cdn.imgfast.io/{public_key}/url/{remote_url}?{parameters}
# Example
https://cdn.imgfast.io/pk_abc123/url/https://example.com/photo.jpg?w=800&f=webpsecurity
Security Requirement
You must configure allowed domains in Settings → Allowed Domains. Only URLs from allowed domains will be processed.
verified_user
Signed URLs
Prevent unauthorized access and URL tampering with HMAC-signed URLs.
| Parameter | Description |
|---|---|
sig | HMAC-SHA256 signature |
exp | Expiration timestamp (Unix seconds) |
# Signed URL format
?w=800&exp=1735689600&sig=a1b2c3d4e5f6...
# Signature generation (pseudo-code)
path = "/pk_abc123/photo.jpg"
params = "w=800&exp=1735689600"
signature = HMAC-SHA256(signing_secret, path + "?" + params)Generate Signed URLs
Node.js
import crypto from 'crypto';
function signUrl(path: string, params: Record<string, string>, secret: string) {
const exp = Math.floor(Date.now() / 1000) + 3600; // 1 hour
const queryString = new URLSearchParams({ ...params, exp: exp.toString() }).toString();
const signature = crypto
.createHmac('sha256', secret)
.update(path + '?' + queryString)
.digest('hex');
return `https://cdn.imgfast.io${path}?${queryString}&sig=${signature}`;
}
// Usage
const signedUrl = signUrl(
'/pk_abc123/photo.jpg',
{ w: '800', f: 'webp' },
process.env.IMGFAST_SIGNING_SECRET
);