URL Structure

Complete reference for constructing imgfast CDN URLs.

link

Base URL

https://cdn.imgfast.io/{public_key}/{image_path}?{parameters}
cdn.imgfast.io

Our global CDN endpoint. All image requests go through this domain.

folder

Path Components

ComponentRequiredDescription
{public_key}YesYour account's public key (imgfast_pk_xxx)
{image_path}YesPath 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=webp
tune

Query Parameters

Transformations are applied via query parameters. Multiple parameters are joined with &.

CategoryParametersLink
Sizew, h, fit, g, ar, dprResizing →
Formatf, qFormat →
Effectsblur, sharpen, brightness, contrast, saturationFilters →
Watermarkwm_text, wm_image, wm_positionWatermark →
Securitysig, expSigned 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=webp
security

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.

ParameterDescription
sigHMAC-SHA256 signature
expExpiration 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
);