nikolvs

payload storage github

by nikolvs
Cloud storage
v3
^3.2.2
MIT

Overview

Summary generated from the README

Stores files from selected Payload upload collections in a GitHub repository using the GitHub REST API through Octokit. It is added as a plugin, and it automatically disables local storage for the collections it handles. You configure the repository owner, repo name, branch and an access token, with optional per-collection prefixes. Requires Payload 3.2.2 or later.

Features

  • Uploads and reads files through the GitHub REST API
  • Enables storage per collection, with an optional path prefix
  • Automatically disables local storage for configured collections
  • Configurable owner, repository and branch, defaulting to main
  • Passes Octokit client options such as authentication
  • Can be switched on or off with an enabled option

Use cases

  • Store Payload media in a GitHub repository instead of local disk
  • Keep uploaded assets versioned alongside project files in a chosen branch

From the author

Payload storage adapter for GitHub

Installation

npm i payload-storage-github

8

Stars

1

Forks

0

Open Issues

2 years ago

Last Updated

41

Weekly Downloads

v1.0.1

npm Version

32.8 KB

Unpacked Size

2

Dependencies

GitHub stars

80 since Sep 6

Show data
GitHub stars by day (UTC)
DateStars
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, 20269
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, 20268
Oct 11, 20268
Oct 10, 20268
Oct 9, 20268
Oct 8, 20268
Oct 7, 20268
Oct 6, 20268
Oct 5, 20268
Oct 4, 20268
Oct 3, 20268
Oct 2, 20268
Oct 1, 20268
Sep 30, 20268
Sep 29, 20268
Sep 28, 20268
Sep 27, 20268
Sep 26, 20268
Sep 25, 20268
Sep 24, 20268
Sep 23, 20268
Sep 22, 20268
Sep 21, 20268
Sep 20, 20268
Sep 19, 20268
Sep 18, 20268
Sep 17, 20268
Sep 16, 20268
Sep 15, 20268
Sep 14, 20268
Sep 13, 20268
Sep 12, 20268
Sep 11, 20268
Sep 10, 20268
Sep 9, 20268
Sep 8, 20268
Sep 7, 20268
Sep 6, 20268
npm weekly downloads

40+15 since Sep 6

Show data
npm weekly downloads by day (UTC)
DateWeekly downloads
Dec 5, 202640
Dec 4, 20269
Dec 3, 202610
Dec 2, 20264
Dec 1, 20265
Nov 30, 20265
Nov 29, 202620
Nov 28, 202621
Nov 27, 202620
Nov 26, 202620
Nov 25, 202620
Nov 24, 202619
Nov 23, 202619
Nov 22, 20265
Nov 21, 20264
Nov 20, 20264
Nov 19, 20264
Nov 18, 202619
Nov 17, 202620
Nov 16, 202621
Nov 15, 202619
Nov 14, 202619
Nov 13, 202620
Nov 12, 202631
Nov 11, 202616
Nov 10, 202619
Nov 9, 202618
Nov 8, 202620
Nov 7, 202620
Nov 6, 202618
Nov 5, 20268
Nov 4, 20268
Nov 3, 20264
Nov 2, 20266
Nov 1, 20265
Oct 31, 20265
Oct 30, 20265
Oct 29, 20263
Oct 28, 20263
Oct 27, 20265
Oct 26, 20265
Oct 25, 20264
Oct 24, 20265
Oct 23, 20265
Oct 22, 20268
Oct 21, 20268
Oct 20, 20266
Oct 19, 20264
Oct 18, 20264
Oct 17, 20267
Oct 16, 20269
Oct 15, 20267
Oct 14, 202622
Oct 13, 202622
Oct 12, 202622
Oct 11, 202623
Oct 10, 202619
Oct 9, 202617
Oct 8, 202616
Oct 7, 20261
Oct 6, 20262
Oct 5, 20262
Oct 4, 20261
Oct 3, 20263
Oct 2, 20266
Oct 1, 20266
Sep 30, 20266
Sep 29, 202621
Sep 28, 202622
Sep 27, 202623
Sep 26, 202625
Sep 25, 202622
Sep 24, 202623
Sep 23, 202623
Sep 22, 202623
Sep 21, 202622
Sep 20, 202622
Sep 19, 202618
Sep 18, 202618
Sep 17, 202619
Sep 16, 202620
Sep 15, 20265
Sep 14, 20268
Sep 13, 20268
Sep 12, 202611
Sep 11, 202627
Sep 10, 202625
Sep 9, 202626
Sep 8, 202626
Sep 7, 202625
Sep 6, 202625

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

Health Score

43/100Fair

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/887320325-root.svg)](https://payloaddirectory.dev/plugins/887320325-root)
HTML
<a href="https://payloaddirectory.dev/plugins/887320325-root"><img src="https://payloaddirectory.dev/badge/887320325-root.svg" alt="Payload Directory"></a>
Updated Dec 3, 2024Created Nov 12, 2024Published Dec 3, 2024

README

GitHub Storage for Payload

This package provides a way to use the GitHub REST API to store files with Payload.

Installation

pnpm add payload-storage-github

Usage

  • Configure the collections object to specify which collections should use the GitHub Storage adapter. The slug must match one of your existing collection slugs.
  • When enabled, this package will automatically set disableLocalStorage to true for each collection.
import { githubStorage } from 'payload-github-storage'
import { Media } from './collections/Media'
import { MediaWithPrefix } from './collections/MediaWithPrefix'

export default buildConfig({
  collections: [Media, MediaWithPrefix],
  plugins: [
    githubStorage({
      collections: {
        [mediaSlug]: true,
        [mediaWithPrefixSlug]: {
          prefix: '/media',
        },
      },

      owner: process.env.GITHUB_REPOSITORY_OWNER,
      repo: process.env.GITHUB_REPOSITORY_NAME,
      branch: process.env.GITHUB_REPOSITORY_BRANCH,

      options: {
        auth: process.env.GITHUB_ACCESS_TOKEN,
      },
    }),
  ],
})

Configuration Options

OptionDescriptionDefault
enabledWhether or not to enable the plugintrue
collectionsCollections to apply the storage to
ownerThe name of the repository owner (GitHub username or organization)
repoThe repository name
branchWhich branch to upload/read files"main"
optionsOctokit client configuration. See Docs

Similar plugins