npm package discovery and stats viewer.

Discover Tips

  • General search

    [free text search, go nuts!]

  • Package details

    pkg:[package-name]

  • User packages

    @[username]

Sponsor

Optimize Toolset

I’ve always been into building performant and accessible sites, but lately I’ve been taking it extremely seriously. So much so that I’ve been building a tool to help me optimize and monitor the sites that I build to make sure that I’m making an attempt to offer the best experience to those who visit them. If you’re into performant, accessible and SEO friendly sites, you might like it too! You can check it out at Optimize Toolset.

About

Hi, 👋, I’m Ryan Hefner  and I built this site for me, and you! The goal of this site was to provide an easy way for me to check the stats on my npm packages, both for prioritizing issues and updates, and to give me a little kick in the pants to keep up on stuff.

As I was building it, I realized that I was actually using the tool to build the tool, and figured I might as well put this out there and hopefully others will find it to be a fast and useful way to search and browse npm packages as I have.

If you’re interested in other things I’m working on, follow me on Twitter or check out the open source projects I’ve been publishing on GitHub.

I am also working on a Twitter bot for this site to tweet the most popular, newest, random packages from npm. Please follow that account now and it will start sending out packages soon–ish.

Open Software & Tools

This site wouldn’t be possible without the immense generosity and tireless efforts from the people who make contributions to the world and share their work via open source initiatives. Thank you 🙏

© 2026 – Pkg Stats / Ryan Hefner

payload-plugin-google-photos

v1.0.7

Published

Payload 3 plugin that imports Google Photos Picker selections as independent upload documents

Readme

Payload Google Photos Plugin

Import photos from Google Photos into Payload CMS 3 as true file copies. Admins connect their own Google account, pick media with the official Google Photos Picker API, and the plugin downloads original bytes into whatever upload collections already exist in the host project.

Google’s Library API browse scopes were removed in March 2025. This plugin does not render a custom Photos grid. Picking happens in Google’s picker tab (pickerUri + /autoclose). After import, Payload owns the file — disconnecting Google Photos does not break existing media.

Full Google Cloud + OAuth + env setup: docs/setup.md

Install

pnpm add payload-plugin-google-photos

payload ^3 is a peer dependency.

Usage

import { googlePhotosPlugin } from 'payload-plugin-google-photos'

export default buildConfig({
  plugins: [
    googlePhotosPlugin({
      // optional allowlist; default is every collection with `upload: true`
      // collections: ['media'],
      // mapMediaData: ({ item, collectionSlug, extraData }) => ({ category: 'imported' }),
    }),
  ],
})

Configuration

Options can be set on the plugin or with env vars. Options win when both are set.

| Option | Env var | Notes | | --- | --- | --- | | clientId | GOOGLE_PHOTOS_CLIENT_ID | Required | | clientSecret | GOOGLE_PHOTOS_CLIENT_SECRET | Required | | redirectUri | GOOGLE_PHOTOS_REDIRECT_URI | Default ${serverURL}${routes.api}/google-photos/oauth/callback | | encryptionKey | GOOGLE_PHOTOS_ENCRYPTION_KEY | 32-byte key as 64 hex chars or base64. Falls back to PAYLOAD_SECRET | | collections | — | Optional upload-collection allowlist | | mapMediaData | — | Last programmatic override after auto-fill and the import form | | disabled | — | Keeps plugin collections, skips endpoints and admin UI |

OAuth client ID/secret belong in env, not in git. Never commit downloaded client_secret_*.json files.

The Photos Picker scope is https://www.googleapis.com/auth/photospicker.mediaitems.readonly. Add it under Google Auth Platform → Data access, enable Google Photos Picker API, and keep it checked on Google’s consent screen. See docs/setup.md.

In the admin

Each target upload collection list view gets an Import from Google Photos pill in the list header (same pill / small style as Create New and Bulk Upload):

  1. Open the drawer and Connect Google Photos.
  2. Select from Google Photos (new tab; Google forbids iframes).
  3. Fill any leftover required simple fields once for the batch, like the create form.
  4. Save downloads original bytes (${baseUrl}=d, or =dv for video) and creates documents with Local API payload.create({ collection, data, file }).

Uploads use the destination collection’s existing storage adapter, thumbnails, and imageSizes. Import IDs are stored in the hidden google-photos-imports collection so host media tables are not altered. On Postgres/SQLite the plugin creates its tables and lock-rel columns at startup — no CMS migration files.

Required-field strategy:

  1. Apply field defaultValues and filename-based alt / title / caption / name.
  2. Merge drawer extraData, then mapMediaData.
  3. Prompt leftover simple fields (text, textarea, number, checkbox, select, date).
  4. Block relationship, upload, blocks, array, richText, json, and similar types — supply them with defaultValue or mapMediaData instead.

License

MIT