PixViroDocs

Signed URLs & private assets

Stop others from generating transformations you didn't create, expire links, and keep assets private.

Signed URLs

A signed URL carries a signature segment right after the project:

https://cdn.pixviro.com/{account}/{project}/s--SIG--/v3/c_fill,w_400,h_400/hero
https://cdn.pixviro.com/{account}/{project}/s--SIG.1767225600--/v3/w_400/hero     expires at that unix time

SIG is the base64url (no padding) of the first 16 bytes of HMAC-SHA256(signing secret, "{account}/{project}/{path}" + "|{expires}"), where {path} is the canonical path after the project. A signature can't be moved to another project, asset, version or transformation.

Sign on your server — the SDKs do it locally, without an API call:

import { Delivery } from '@pixviro/sdk';

const signer = new Delivery({ account: 'k3x9p2ab7q', project: 'shop', signingSecret: process.env.PIXVIRO_SIGNING_SECRET });
const url = await signer.signedUrl('hero', {
  transformation: { width: 400, format: 'auto' },
  version: 3,
  expiresAt: new Date(Date.now() + 60 * 60 * 1000),
});

The signing secret is on the project page (Show signing secret). Rotating it invalidates every URL signed with it. Never send it to browsers.

Signing modes

Per project (Starter and up), under Project → Signed URLs:

Mode Unsigned URLs
off Everything works (signatures are still checked when present)
transformations Originals and already generated variants only. New transformations need a signature, so nobody can create — and bill you for — transformations you didn't make.
all Refused (403)

Expired, tampered or wrongly signed URLs answer 403.

Private assets

access: private (Starter and up) makes an asset deliverable only through valid signed URLs — originals, every transformation, every version — whatever the project's mode. Unsigned requests get 404, so a private asset's existence isn't revealed.

Set it at upload (access=private), in a signed upload, or later with PATCH /v1/assets/{id} {"access": "private"}; switching an asset to private purges cached public copies. GET /v1/assets/{id}/srcset signs every candidate of a private asset for one hour.