rubix-studios-pty-ltd

payload media

by rubix-studios-pty-ltd
Media & images
v4
^4.0.0-beta.12
MIT

Overview

Summary generated from the README

Adds stock image and video search to the Payload admin so editors can preview results and import selected media into upload collections. It supports Unsplash, Pexels, Pixabay and Openverse, with provider and licence filters. Configured through a plugin function with provider API keys; the 2.x line targets Payload v4 and the 1.x line targets Payload v3.

Features

  • Search images from four providers and videos from Pexels and Pixabay
  • Filter results by provider and licence, and preview before import
  • Optional creator, source and licence metadata saved on the upload document
  • Administrator-only access by default, with custom access and rate limit callbacks
  • Unsplash download tracking before selection
  • Openverse application registration with encrypted stored credentials

Use cases

  • Let editors add licensed stock photos to the media library without leaving the admin
  • Import stock videos into upload collections with attribution stored alongside
  • Restrict and rate limit external media searches for a team

From the author

A Payload CMS plugin that integrates with stock image and video providers including Unsplash, Pexels and Pixabay.

Installation

npm i @rubixstudios/payload-media

8

Stars

1

Forks

0

Open Issues

Today

Last Updated

900

Weekly Downloads

v3.0.2

npm Version

141.3 KB

Unpacked Size

0

Dependencies

GitHub stars

8+2 since Sep 7

Show data
GitHub stars by day (UTC)
DateStars
Dec 6, 20268
Dec 5, 20268
Dec 4, 20268
Dec 3, 20268
Dec 2, 20268
Dec 1, 20268
Nov 30, 20268
Nov 29, 20268
Nov 28, 20268
Nov 27, 20268
Nov 26, 20268
Nov 25, 20268
Nov 24, 20268
Nov 23, 20268
Nov 22, 20268
Nov 21, 20268
Nov 20, 20268
Nov 19, 20268
Nov 18, 20268
Nov 17, 20268
Nov 16, 20268
Nov 15, 20268
Nov 14, 20268
Nov 13, 20268
Nov 12, 20268
Nov 11, 20268
Nov 10, 20268
Nov 9, 20268
Nov 8, 20268
Nov 7, 20268
Nov 6, 20268
Nov 5, 20268
Nov 4, 20268
Nov 3, 20268
Nov 2, 20268
Nov 1, 20268
Oct 31, 20268
Oct 30, 20268
Oct 29, 20268
Oct 28, 20268
Oct 27, 20268
Oct 26, 20268
Oct 25, 20268
Oct 24, 20268
Oct 23, 20268
Oct 22, 20268
Oct 21, 20268
Oct 20, 20268
Oct 19, 20268
Oct 18, 20268
Oct 17, 20268
Oct 16, 20268
Oct 15, 20268
Oct 14, 20268
Oct 13, 20268
Oct 12, 20267
Oct 11, 20267
Oct 10, 20266
Oct 9, 20266
Oct 8, 20266
Oct 7, 20266
Oct 6, 20266
Oct 5, 20266
Oct 4, 20266
Oct 3, 20266
Oct 2, 20266
Oct 1, 20266
Sep 30, 20266
Sep 29, 20266
Sep 28, 20266
Sep 27, 20266
Sep 26, 20266
Sep 25, 20266
Sep 24, 20266
Sep 23, 20266
Sep 22, 20266
Sep 21, 20266
Sep 20, 20266
Sep 19, 20266
Sep 18, 20266
Sep 17, 20266
Sep 16, 20266
Sep 15, 20266
Sep 14, 20266
Sep 13, 20266
Sep 12, 20266
Sep 11, 20266
Sep 10, 20266
Sep 9, 20266
Sep 8, 20266
Sep 7, 20266
npm weekly downloads

766+579 since Sep 7

Show data
npm weekly downloads by day (UTC)
DateWeekly downloads
Dec 6, 2026766
Dec 5, 2026783
Dec 4, 2026803
Dec 3, 2026917
Dec 2, 2026888
Dec 1, 2026873
Nov 30, 20261,137
Nov 29, 20261,079
Nov 28, 20261,056
Nov 27, 20261,164
Nov 26, 2026764
Nov 25, 2026748
Nov 24, 2026746
Nov 23, 2026637
Nov 22, 2026652
Nov 21, 2026980
Nov 20, 20261,159
Nov 19, 2026977
Nov 18, 20261,041
Nov 17, 20261,040
Nov 16, 2026893
Nov 15, 2026876
Nov 14, 2026560
Nov 13, 2026367
Nov 12, 2026389
Nov 11, 2026521
Nov 10, 2026575
Nov 9, 2026578
Nov 8, 2026580
Nov 7, 2026586
Nov 6, 2026489
Nov 5, 2026460
Nov 4, 2026349
Nov 3, 2026279
Nov 2, 2026275
Nov 1, 2026837
Oct 31, 2026807
Oct 30, 2026768
Oct 29, 2026750
Oct 28, 2026656
Oct 27, 2026673
Oct 26, 2026824
Oct 25, 2026249
Oct 24, 2026242
Oct 23, 2026227
Oct 22, 2026249
Oct 21, 2026332
Oct 20, 2026344
Oct 19, 2026583
Oct 18, 2026585
Oct 17, 2026616
Oct 16, 2026806
Oct 15, 2026797
Oct 14, 2026734
Oct 13, 2026726
Oct 12, 2026347
Oct 11, 2026352
Oct 10, 2026332
Oct 9, 2026168
Oct 8, 2026202
Oct 7, 2026205
Oct 6, 2026173
Oct 5, 2026143
Oct 4, 2026140
Oct 3, 2026130
Oct 2, 2026130
Oct 1, 2026108
Sep 30, 2026112
Sep 29, 2026125
Sep 28, 2026134
Sep 27, 2026277
Sep 26, 2026287
Sep 25, 2026269
Sep 24, 2026271
Sep 23, 2026307
Sep 22, 2026302
Sep 21, 2026296
Sep 20, 2026149
Sep 19, 2026152
Sep 18, 2026189
Sep 17, 2026199
Sep 16, 2026183
Sep 15, 2026182
Sep 14, 2026185
Sep 13, 2026180
Sep 12, 2026179
Sep 11, 2026156
Sep 10, 2026159
Sep 9, 2026168
Sep 8, 2026196
Sep 7, 2026187

Each point is npm's rolling 7-day download count.

Health Score

83/100Excellent

Composite score based on GitHub activity, stars, npm downloads, publish recency, dependency count, and package size.

Badge for your README

Payload Directory health badge
Markdown
[![Payload Directory](https://payloaddirectory.dev/badge/1243543278-root.svg)](https://payloaddirectory.dev/plugins/1243543278-root)
HTML
<a href="https://payloaddirectory.dev/plugins/1243543278-root"><img src="https://payloaddirectory.dev/badge/1243543278-root.svg" alt="Payload Directory"></a>
Updated Dec 5, 2026Created May 19, 2026Published Dec 4, 2026

README

Payload CMS Media Plugin

Payload CMS Media Plugin adds stock image and video search to the Payload Admin interface. Search Unsplash, Pexels, Pixabay and Openverse, apply provider-specific filters, preview results, and import selected media into upload collections.

Stock image selection

Stock video selection

Compatibility

The plugin maintains two release lines, with Payload CMS v4 as the primary release and Payload CMS v3 maintained separately.

Payload CMSPlugin versionRelease branchnpm dist-tag
v42.x and latermainlatest
v31.xpayload-v3payload-v3

Install the release matching your Payload version. The latest tag targets Payload v4 after the v4 release is published.

Installation

Payload CMS v4

Install the latest release.

pnpm add @rubixstudios/payload-media

Payload CMS v3

Install from the dedicated v3 release channel.

pnpm add @rubixstudios/payload-media@payload-v3

Configuration

Register the plugin in payload.config.ts. The following options apply to the updated Payload v4 release.

import { buildConfig } from 'payload'
import { mediaPlugin } from '@rubixstudios/payload-media'

export default buildConfig({
  plugins: [
    mediaPlugin({
      pexels: process.env.API_KEY_PEXELS,
      pixabay: process.env.API_KEY_PIXABAY,
      unsplash: process.env.API_KEY_UNSPLASH,
      openverse: true,
      collections: ['media'],
      attribution: true,
    }),
  ],
})
OptionDefaultDescription
pexelsDisabledPexels API key
pixabayDisabledPixabay API key
unsplashDisabledUnsplash access key
openversefalseEnable Openverse images and optional application registration
collectionsAll upload collectionsSlugs receiving the media search control
attributionfalseAdd editable mediaAttribution metadata to selected collections
accessAdmin auth collectionCustom Payload access function returning a boolean
rateLimitUnsetOptional callback receiving { req, provider, operation }; return false to reject
disabledfalseDisable plugin registration

Openverse

Enable openverse: true to search anonymously immediately. Select Connect Openverse in the media drawer to register an application using the signed-in administrator's email address. Verify the email sent by Openverse to unlock higher limits.

The application is shared across authorised users. Credentials are encrypted using AES-256-GCM and persisted in the hidden payload-media-credentials collection. OAuth tokens are cached in server memory and renewed automatically. No extra environment variables are required.

Existing application credentials can be configured directly, without automatic registration:

openverse: {
  clientId: process.env.OPENVERSE_CLIENT_ID!,
  clientSecret: process.env.OPENVERSE_CLIENT_SECRET!,
},

For automatic registration, an optional encryptionSecret can replace the Payload secret. Keep it consistent across replicas and backups. Changing or losing the key prevents decryption of stored credentials.

A unique database index on the internal collection's key field is required before registration. If registration fails after the reservation is created, the plugin deliberately retains the reservation to prevent duplicate external applications. Review the provider state before resetting it or configuring existing credentials.

Provider keys

Keep credentials server-side. For Unsplash, use the application's access key rather than its secret key.

Features

  • Search images from four providers and videos from Pexels and Pixabay.
  • Browse results, filter by provider and licence, and import through Payload's upload controls.
  • Optional creator, source and licensing metadata saved with the upload document.
  • Administrator access by default, custom access policies and rate limiting.
  • Unsplash download tracking before selection, with failure feedback.

Upgrade notes

The updated release defaults to the configured admin authentication collection. Custom access functions must return true for authenticated users. Download tracking now uses POST /api/providers/unsplash/track-download with a JSON url property. Search responses are no longer persisted in browser storage across sessions.

Regenerate the admin import map and Payload types. SQL adapters require a migration when enabling automatic Openverse registration or attribution fields. Verify the unique registration index before connecting Openverse.

Remote imports continue to use Payload's native upload controls. Configure pasteURL.allowList for trusted sources when server-side fetching is required; never allow unrestricted external fetching. Openverse indexes multiple source hosts, so some assets may require manual download or a trusted allowlist entry. Review attribution when replacing an existing file.

Usage and liability

Media availability, licensing, attribution, and permitted uses depend on the source provider. Review the applicable provider terms and licence conditions before using imported assets.

Rubix Studios, its developers, and contributors bear no responsibility for how imported media is used.

License

This project is licensed under the MIT License - see the LICENSE file for details.

Support

For support or inquiries:

Author

Rubix Studios
https://rubixstudios.com.au

Similar plugins