Skip to main content
/t/* is public: anyone who knows a URL can request any transformation of it. Signed URLs close that off. Your backend signs the exact URL it wants to allow, and the server refuses anything else.
The signature is an HMAC-SHA256 of the path, keyed on API_SECRET, truncated to 16 hex characters. On every request the server recomputes it and compares in constant time. A signature that does not verify gets 401. One that is missing or the wrong length gets 400, before any comparison happens. Sign {transformations}/{file-path} when there are transformations, {file-path} alone when there are none. Change either part of the URL and the signature stops matching, which is what stops a visitor editing w_200 into w_5000.

Setup

1. Set API_SECRET

Add API_SECRET to your environment. It must be at least 16 characters long. Scaffolded with the Openinary CLI? A 64-character API_SECRET is already in your .env, so skip to step 2.
Then add it to your environment:
Keep API_SECRET private. Anyone who obtains it can generate valid signatures for any file and transformation.

2. Generate signatures in your backend

Use crypto.createHmac (Node.js) or an equivalent library in your language. Never generate signatures client-side.
For the endpoint URL format and error responses, see the Authenticated Transform API reference.

Security considerations

Changing any character in the transformation string or file path invalidates the signature. A signature for w_800,h_600/photo.jpg cannot be reused for w_400,h_300/photo.jpg.
The server uses crypto.timingSafeEqual to compare signatures. This prevents attackers from deducing valid signatures by measuring response time differences.
Signed URLs do not have a built-in expiry. If you need time-limited URLs, append an expiry timestamp to the file path or transformation string and enforce it in a reverse proxy or middleware layer.
If API_SECRET is leaked, immediately replace it with a new value and restart the server. All previously generated signed URLs will become invalid.

Image Transformations

Full reference for transformation parameters you can sign.

Server Configuration

How to set API_SECRET and other server options.

Sign Upload

A separate use of API_SECRET: mint short-lived signatures for direct client-side uploads, rather than signing transformation URLs.