Skip to main content
thumbnail populates a hidden thumbnailURL field on your upload documents, which the admin panel uses to show a preview image in list and edit views, and which is available in every API response.
payload.config.ts
  • Images — uses the original file, or a specific size if sizeName is set.
  • Bunny Stream videos — uses the frame captured at stream.thumbnailTime.

Options

Cache-busting with appendTimestamp

Thumbnails have urlTransform.appendTimestamp on by default. When a file is replaced (for example, during image cropping), the timestamp changes and browsers fetch the new version instead of a cached copy. While it is enabled, the plugin also disables Payload’s cache tags for the thumbnail field, to avoid caching conflicts. Opt out in the options if you don’t want it:
To make this effective on Bunny’s side too, go to your Pull Zone → Caching → enable Vary Cache for URL Query String, and add t to the vary parameter list.If you need immediate cache invalidation everywhere instead of relying on the browser refetching, use cache purging.

Resizing with queryParams

Using a named image size

Custom transform function

For full control over the thumbnail URL, pass a function as thumbnail.urlTransform. It replaces appendTimestamp and queryParams, and you build the URL yourself. sizeName and streamAnimated still apply.
The function receives the same arguments as the urlTransform function (baseUrl, collection, filename, prefix, data) and returns the final URL string.

Collection overrides

A collection thumbnail keeps the global thumbnail.urlTransform unless it sets its own. A collection thumbnail.urlTransform object merges onto a global object and replaces a global function. See Collection overrides for the full list of options you can tune per collection.