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 variant if
sizeNameis set. - Bunny Stream videos — uses the frame captured at
stream.thumbnailTime.
Thumbnail URLs
With Payload access control on (the default), an image thumbnail URL is Payload’s<routes.api>/<collection>/file/<filename>, with the variant’s file name when sizeName is set. A Stream video thumbnail URL is the plugin’s own endpoint, <routes.api>/storage-bunny/stream/thumbnail/<collection>/<id>/<videoId>/thumbnail.jpg (preview.webp with streamAnimated). <routes.api> is the API route of your Payload config, /api by default. The endpoint reads the document with Payload access control and fetches the image from the Stream CDN, so Payload upload transformers never handle it. See the API reference.
With disablePayloadAccessControl: true, both point straight at the Bunny CDN, signed when signedUrls is on.
thumbnailURL is computed each time a document is read, so it always has the current form.
Options
Cache-busting with appendTimestamp
Thumbnails haveurlTransform.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:
Resizing with queryParams
width, height or withoutEnlargement parameter. It then resizes the image on your server, and none of the parameters reach Bunny. Stream video thumbnails always send them to Bunny.
Using a named image size
sizeName is the name of a variant that sharpTransformer({ collections: { <slug>: { variants } } }) from @payloadcms/transformer-sharp generates for the collection.
Custom transform function
For full control over the thumbnail URL, pass a function asthumbnail.urlTransform. It replaces appendTimestamp and queryParams, and you build the URL yourself. sizeName and streamAnimated still apply.
urlTransform function (baseUrl, collection, filename, prefix, data) and returns the final URL string.
Collection overrides
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.