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 🙏

© 2025 – Pkg Stats / Ryan Hefner

payload-nextcloud

v0.1.0

Published

A Payload CMS plugin that integrates Nextcloud as a storage adapter

Downloads

87

Readme

payload-nextcloud

Nextcloud storage adapter for Payload CMS (Payload 3). It integrates Nextcloud WebDAV for file uploads and can automatically create public share links via the OCS Files Sharing API.

Features

  • Upload files to Nextcloud via WebDAV
  • Optional public share link creation (sets nextcloud.share_url on uploaded document)
  • Exposes a direct WebDAV URL (nextcloud.webdav_url) for internal use
  • Adds an admin sidebar group with Nextcloud metadata and sync status fields

Requirements

  • Payload ^3.37.0 (peerDependency)
  • Node 18+ (or 20+)
  • A Nextcloud account and preferably an App Password (token)

Install

pnpm add payload-nextcloud @payloadcms/plugin-cloud-storage webdav

Quick start Add the plugin to your Payload config and supply Nextcloud credentials and WebDAV settings.

// payload.config.ts
import { payloadNextcloud } from 'payload-nextcloud'

export default buildConfig({
  collections: [
    {
      slug: 'media',
      upload: {
        mimeTypes: ['image/*', 'application/pdf'],
      },
      fields: [/* your fields */],
    },
  ],
  plugins: [
    payloadNextcloud({
      collections: {
        // enable integration for a collection
        media: true,
      },
      nextcloud: {
        auth: {
          username: process.env.NEXTCLOUD_USERNAME || '',
          // Prefer app password (token). Provide ONE of token or password.
          token: process.env.NEXTCLOUD_TOKEN,
          // password: process.env.NEXTCLOUD_PASSWORD,
        },
        metadata: {
          // optional custom WebDAV properties namespace + field map
          customPropertiesNamespace: 'http://payloadcms.com/ns/nextcloud',
          fieldMap: {
            'nextcloud.custom_metadata.title': 'pc:title',
            'nextcloud.custom_metadata.description': 'pc:description',
          },
        },
        webdav: {
          // Base Nextcloud URL, e.g. https://cloud.example.com
          baseUrl: process.env.NEXTCLOUD_URL || '',
          // If omitted, defaults to /remote.php/dav/files/{username}
          filesPath: process.env.NEXTCLOUD_FILESPATH,
          // Optional root directory under the user's files area
          rootDirectory: process.env.NEXTCLOUD_ROOTDIR || '/Payload',
          timeoutMs: 15000,
          // verifyTLS: false, // only in dev with self-signed certs
        },
      },
    }),
  ],
})

What gets added to your Media collection

  • A nextcloud group in the sidebar with read-only fields:
    • fileId, path, name, size, mimeType, etag, lastModified, permissions, isDirectory
    • webdav_url (direct WebDAV path)
    • share_url (public link if sharing succeeds)
  • A custom_metadata group (optional editable fields you can sync via WebDAV PROPPATCH)
  • A sync_status group to track last sync and errors

Public share links

  • On successful upload, the plugin attempts to create a public share via Nextcloud OCS API.
  • If successful, nextcloud.share_url will be set to the base public link.
  • If you prefer a direct binary URL, consider using ${share_url}/download in your app.

Nextcloud app password guidance

  • Strongly recommended: create an App Password in Nextcloud and use it as your token.
    • Nextcloud: Settings → Security → Create new app password → copy the generated password
    • Use that value as NEXTCLOUD_TOKEN; do not share your main account password
  • OCS API requires the OCS-APIRequest: true header and Basic auth—we handle this internally.
  • For self-signed certificates in dev, you can temporarily set verifyTLS: false (avoid in production).

Development notes

  • This package’s top-level exports point to dist, not src.
  • You need to build before running the dev project:
    • pnpm build
    • pnpm dev
  • The dev folder is for local testing only and is not published.

License MIT

Author / Support Update package.json with your name and repository URL. Tag your repo with payload-plugin on GitHub for discoverability.