open-index/open-npm huggingface dataset:
npm package: @payload-enchants/better-localized-fields
Description: ## Install
Author: r1tsuu
Latest version: 1.2.2

# Better Localized Fields Plugin for Payload 3.0

## Install

`pnpm add @payload-enchants/better-localized-fields`

Add into your payload.config.ts:

```ts
import { betterLocalizedFields } from '@payload-enchants/better-localized-fields';

export default buildConfig({
  // ...your config
  plugins: [betterLocalizedFields()],
});
```

## About

Adds to every localized field locales tabs with a field's value on selected locale.
![ezgif-5-0fdef54e28](https://github.com/r1tsuu/payload-enchants/assets/64744993/7a27b7f5-f0cb-466d-8e0f-75177cc17f48)
npm package: @payload-enchants/better-use-as-title
Description: [screen-capture.webm](https://github.com/r1tsuu/payload-enchants/assets/64744993/ba3a8e37-3f5e-48a4-ac25-9ea81bc43b01)
Author: r1tsuu
Latest version: 1.2.2

# Better `useAsTitle` property for Payload 3.0

[screen-capture.webm](https://github.com/r1tsuu/payload-enchants/assets/64744993/ba3a8e37-3f5e-48a4-ac25-9ea81bc43b01)

## Install

`pnpm add @payload-enchants/better-use-as-title`

Add into your payload.config.ts:

```ts
import { betterUseAsTitle } from '@payload-enchants/better-use-as-title';

export default buildConfig({
  // ...your config
  plugins: [
    betterUseAsTitle({
      // List of collections to apply a custom `useAsTitle`
      collections: [
        {
          // Collection slug
          slug: 'better-use-as-title-test',

          // `data` is the current document data, req is instance of PayloadRequest, from which you can get `payload` and `user`
          // could be asynchronous as well
          useAsTitle: ({ data, req }) =>
            `${data.firstName ?? ''} - ${data.secondName}, ${data.age} y.o`,

          // override properties for useAsTitle field for this collection
          fieldOverride: {
            name: 'customNameForCollection',
          },
        },
      ],
      // override properties for useAsTitle field globally
      fieldOverride: {
        name: 'customName',
      },
    }),
  ],
});
```

## Note for data that already exist

You would need to write a custom script that updates all your docs like this

```
payload.update({
  collection: 'posts',
  where: {}
})
```
npm package: @payload-enchants/docs-reorder
Description: ## Install
Latest version: 1.2.2

# Docs reorder plugin for Payload 3.0 beta

## Install

`pnpm add @payload-enchants/docs-reorder`

## About

Adds an option to re-order collection documents with drag n drop (almost like array/blocks items). Then on your front end you can query documents with applied sort by `docOrder` field.

## Video

https://github.com/r1tsuu/payload-plugin-collections-docs-order/assets/64744993/2c13cdd9-f809-4c40-82c6-0b6f78997f74

In your payload.config.ts:

```ts
/// ....
import { docsReorder } from '@payload-enchants/docs-reorder';

export default buildConfig({
  // ...
  plugins: [
    docsReorder({
      collections: [{ slug: 'pages' }], // The feature will be enabled only for collections that are in this array.,
      access: ({ req, data }) => {
        // Optional, configure access for `saveChanges` endpoint, default: Boolean(req.user)
        return req.user?.collection === 'admins';
      },
    }),
  ],
});
```

## Querying with applied plugin's sort.

REST:

```ts
fetch('http://localhost:3000/api/examples?sort=docOrder').then((res) => res.json());
```

Local API:

```ts
payload.find({ collection: 'examples', sort: 'docOrder' });
```

GraphQL:

```graphql
query {
  Examples(sort: "docOrder") {
    docs {
      title
    }
  }

```

## Script to setup for collections that had documents before installing the plugin

1. Place [this file](../../test/src/scripts/docsReorderSetupScript.ts) to your src/scripts directory
2. Change here list to your list of collection slugs with enabled plugin

```ts
const collections: (keyof GeneratedTypes['collections'])[] = ['docs-reoder-examples'];
```

3. Run pnpm tsx ./src/scripts/docsReorderSetupScript.ts
npm package: @payload-enchants/fields-select
Description: ## Install
Author: r1tsuu
Latest version: 1.2.2

# Fields select plugin for Payload 3.0

## Install

`pnpm add @payload-enchants/fields-select`

In your payload.config.ts:

```ts
/// ....
import { fieldsSelect } from '@payload-enchants/fields-select';

export default buildConfig({
  // ...
  plugins: [fieldsSelect()],
});
```

## Description

Adds an option to select fields from Local API / REST API response like with GraphQL
As well solves a problem, when you need only specific fields to populate from relationship field with `defaultSelect` option
Could significally reduce your pages data sizes, especially when they are related to each other.
PR with more powerful version of this to Payload - https://github.com/payloadcms/payload/pull/5942

## Usage

### Local API:

```ts
/** As well findByID **/
payload.find({
  collection: 'posts',
  context: {
    /**
     * Selects:
     * top level id, title fields
     * text field from "nestedGroup" group field
     * all fields from "nestedArray" field
     * "title" field from populated relationship document
     **/
    select: ['id', 'title', 'nestedGroup.text', 'nestedArray', 'relationship.title'],
  },
});
```

### REST API:

Use `select` query parameter, example:
`?select[0]=id&select[1]=title`

### Default Select option for relationship fields

```ts
const linkField: RelationshipField = {
  custom: {
    /** Field will be populated only with id, slug and title fields **/
    defaultSelect: ['id', 'slug', 'title'],
  },
  name: 'link',
  relationTo: 'pages',
};
```
npm package: @payload-enchants/sdk
Description: ## Install
Author: r1tsuu
Latest version: 1.2.2

# Typescript-Safe Payload API Client

## Install

`pnpm add @payload-enchants/sdk`

## Usage

```ts
import { PayloadApiClient } from '@payload-enchants/sdk';

// Import it from generated types
import { Config } from 'payload-types';

const client = new PayloadApiClient<Config>({
  apiURL: 'http://localhost:3000/api',
});

// The syntax is the same as in the Local API, except for `updateById` and `deleteById` (additional operations)
const data = await client.find({ collection: 'pages' });
```

To rewrite headers, you can pass your `fetcher`

```ts
const client = new PayloadApiClient<Config>({
  apiURL: '',
  fetcher: (url, init) => {
    return fetch(url, {
      ...(init ?? {}),
      headers: {
        ...(init?.headers ?? {}),
        Authorization: 'API-Key users some-api-key',
      },
    });
  },
});
```

### Fields selection

This package provides integratation with [@payload-enchants/fields-select](../fields-select/) plugin

```ts
const { docs } = await client.find({ collection: 'pages', select: ['id', 'createdAt'] });

docs[0].createdAt; // ok
docs[0].id; // ok
docs[0].updatedAt; // err, Property 'updatedAt' does not exist on type 'Pick<Page, "id" | "createdAt">'
```
npm package: @payload-enchants/seo
Description: [Official docs](https://payloadcms.com/docs/plugins/seo)
Author: r1tsuu
Latest version: 1.2.2

# Alternative version of official @payloadcms/plugin-seo package with AI generating improvements

[Official docs](https://payloadcms.com/docs/plugins/seo)

## List of the added options:

`openaiApiKey`
API key for OpenAI

`generateTitleAi`:
Should return prompt, example: `"Generate meta SEO title for <type of site> site in language=${data.locale}"`

`generateDescriptionAi`:
Should return prompt, example: "`Generate meta SEO description for <type of site> site in language=${data.locale}`"

The args are the same as `generateTitle` and `generateDescription`
npm package: @payloadcms/db-d1-sqlite
Description: The officially supported D1 SQLite database adapter for Payload
Author: Payload
Latest version: 3.82.1

# Payload D1 SQLite Adapter

Official D1 SQLite adapter for [Payload](https://payloadcms.com).

- [Main Repository](https://github.com/payloadcms/payload)
- [Payload Docs](https://payloadcms.com/docs)

## Installation

```bash
npm install @payloadcms/db-d1-sqlite
```

## Usage

```ts
import { sqliteD1Adapter } from '@payloadcms/db-d1-sqlite'

export default buildConfig({
  // Your config goes here
  collections: [
    // Collections go here
  ],
  // Configure the D1 adapter here
  db: sqliteD1Adapter({
    // D1-specific arguments go here.
    // `binding` is required and should match the D1 database binding name in your Cloudflare Worker environment.
    binding: cloudflare.env.D1,
  }),
})
```

More detailed usage can be found in the [Payload Docs](https://payloadcms.com/docs/database/sqlite).
npm package: @payloadcms/db-mongodb
Description: The officially supported MongoDB database adapter for Payload
Author: Payload
Latest version: 3.82.1

# Payload MongoDB Adapter

Official MongoDB adapter for [Payload](https://payloadcms.com).

- [Main Repository](https://github.com/payloadcms/payload)
- [Payload Docs](https://payloadcms.com/docs)

## Installation

```bash
npm install @payloadcms/db-mongodb
```

## Usage

```ts
import { buildConfig } from 'payload'
import { mongooseAdapter } from '@payloadcms/db-mongodb'

export default buildConfig({
  db: mongooseAdapter({
    url: process.env.DATABASE_URL,
  }),
  // ...rest of config
})
```

More detailed usage can be found in the [Payload Docs](https://payloadcms.com/docs/configuration/overview).
npm package: @payloadcms/db-postgres
Description: The officially supported Postgres database adapter for Payload
Author: Payload
Latest version: 3.82.1

# Payload Postgres Adapter

Official Postgres adapter for [Payload](https://payloadcms.com).

- [Main Repository](https://github.com/payloadcms/payload)
- [Payload Docs](https://payloadcms.com/docs)

## Installation

```bash
npm install @payloadcms/db-postgres
```

## Usage

```ts
import { buildConfig } from 'payload'
import { postgresAdapter } from '@payloadcms/db-postgres'

export default buildConfig({
  db: postgresAdapter({
    pool: {
      connectionString: process.env.DATABASE_URL,
    },
  }),
  // ...rest of config
})
```

More detailed usage can be found in the [Payload Docs](https://payloadcms.com/docs/configuration/overview).
npm package: @payloadcms/db-sqlite
Description: The officially supported SQLite database adapter for Payload
Author: Payload
Latest version: 3.82.1

# Payload SQLite Adapter

Official SQLite adapter for [Payload](https://payloadcms.com).

- [Main Repository](https://github.com/payloadcms/payload)
- [Payload Docs](https://payloadcms.com/docs)

## Installation

```bash
npm install @payloadcms/db-sqlite
```

## Usage

```ts
import { buildConfig } from 'payload/config'
import { sqliteAdapter } from '@payloadcms/db-sqlite'

export default buildConfig({
  db: sqliteAdapter({
    client: {
      url: process.env.DATABASE_URL,
    },
  }),
  // ...rest of config
})
```

More detailed usage can be found in the [Payload Docs](https://payloadcms.com/docs/configuration/overview).
npm package: @payloadcms/db-vercel-postgres
Description: Vercel Postgres adapter for Payload
Author: Payload
Latest version: 3.82.1

# Payload Postgres Adapter

[Vercel Postgres](https://vercel.com/docs/storage/vercel-postgres) adapter for [Payload](https://payloadcms.com).

- [Main Repository](https://github.com/payloadcms/payload)
- [Payload Docs](https://payloadcms.com/docs)

## Installation

```bash
npm install @payloadcms/db-vercel-postgres
```

## Usage

### Explicit Connection String

```ts
import { buildConfig } from 'payload'
import { vercelPostgresAdapter } from '@payloadcms/db-vercel-postgres'

export default buildConfig({
  db: vercelPostgresAdapter({
    pool: {
      connectionString: process.env.DATABASE_URL,
    },
  }),
  // ...rest of config
})
```

### Automatic Connection String Detection

Have Vercel automatically detect from environment variable (typically `process.env.POSTGRES_URL`)

```ts
export default buildConfig({
  db: postgresAdapter(),
  // ...rest of config
})
```

More detailed usage can be found in the [Payload Docs](https://payloadcms.com/docs/configuration/overview).
npm package: @payloadcms/email-nodemailer
Description: Payload Nodemailer Email Adapter
Author: Payload
Latest version: 3.82.1

# Nodemailer Email Adapter for Payload

This adapter allows you to send emails using the [Nodemailer](https://nodemailer.com/) library.

It abstracts all of the email functionality that was in Payload by default in 2.x into a separate package.

**NOTE:** Configuring email in Payload 3.0 is now completely optional. However, you will receive a startup warning that email is not configured and also a message if you attempt to send an email.

## Installation

```sh
pnpm add @payloadcms/email-nodemailer nodemailer
```

## Usage

### Using nodemailer.createTransport

```ts
import { nodemailerAdapter } from '@payloadcms/email-nodemailer'
import nodemailer from 'nodemailer'

export default buildConfig({
  email: nodemailerAdapter({
    defaultFromAddress: 'info@payloadcms.com',
    defaultFromName: 'Payload',
    // Any Nodemailer transport
    transport: await nodemailer.createTransport({
      host: process.env.SMTP_HOST,
      port: 587,
      auth: {
        user: process.env.SMTP_USER,
        pass: process.env.SMTP_PASS,
      },
    }),
  }),
})
```

### Using transportOptions

```ts
import { nodemailerAdapter } from '@payloadcms/email-nodemailer'

export default buildConfig({
  email: nodemailerAdapter({
    defaultFromAddress: 'info@payloadcms.com',
    defaultFromName: 'Payload',
    // Nodemailer transportOptions
    transportOptions: {
      host: process.env.SMTP_HOST,
      port: 587,
      auth: {
        user: process.env.SMTP_USER,
        pass: process.env.SMTP_PASS,
      },
    },
  }),
})
```

During development, if you pass nothing to `nodemailerAdapter`, it will use the [ethereal.email](https://ethereal.email) service.

This will log the ethereal.email details to console on startup.

```ts
import { nodemailerAdapter } from '@payloadcms/email-nodemailer'

export default buildConfig({
  email: nodemailerAdapter(), // This will be the old ethereal.email functionality
})
```
npm package: @payloadcms/email-resend
Description: Payload Resend Email Adapter
Author: Payload
Latest version: 3.82.1

# Resend REST Email Adapter

This adapter allows you to send emails using the [Resend](https://resend.com) REST API.

## Installation

```sh
pnpm add @payloadcms/email-resend
```

## Usage

- Sign up for a [Resend](https://resend.com) account
- Set up a domain
- Create an API key
- Set API key as RESEND_API_KEY environment variable
- Configure your Payload config

```ts
// payload.config.js
import { resendAdapter } from '@payloadcms/email-resend'

export default buildConfig({
  email: resendAdapter({
    defaultFromAddress: 'dev@payloadcms.com',
    defaultFromName: 'Payload CMS',
    apiKey: process.env.RESEND_API_KEY || '',
  }),
})
```
npm package: @payloadcms/kv-redis
Description: Redis KV adapter for Payload
Author: Payload
Latest version: 3.82.1

# Redis KV Adapter for Payload (beta)

This package provides a way to use [Redis](https://redis.io) as a KV adapter with Payload.

## Installation

```sh
pnpm add @payloadcms/kv-redis
```

## Usage

```ts
import { redisKVAdapter } from '@payloadcms/kv-redis'

export default buildConfig({
  collections: [Media],
  kv: redisKVAdapter({
    // Redis connection URL. Defaults to process.env.REDIS_URL
    redisURL: 'redis://localhost:6379',
    // Optional prefix for Redis keys to isolate the store. Defaults to 'payload-kv'
    keyPrefix: 'kv-storage',
  }),
})
```

Then you can access the KV storage using `payload.kv`:

```ts
await payload.kv.set('key', { value: 1 })
const data = await payload.kv.get('key')
payload.logger.info(data)
```
npm package: @payloadcms/plugin-form-builder
Description: Form builder plugin for Payload CMS
Author: Payload
Latest version: 3.82.1

# Payload Form Builder Plugin

A plugin for [Payload](https://github.com/payloadcms/payload) to easily allow admin editors to build and manage forms within the admin panel.

- [Source code](https://github.com/payloadcms/payload/tree/main/packages/plugin-form-builder)
- [Documentation](https://payloadcms.com/docs/plugins/form-builder)
- [Documentation source](https://github.com/payloadcms/payload/tree/main/docs/plugins/form-builder.mdx)
npm package: @payloadcms/plugin-import-export
Description: Import-Export plugin for Payload
Author: Payload
Latest version: 3.82.1

# Payload Import/Export Plugin

A plugin for [Payload](https://github.com/payloadcms/payload) to easily import and export data.

- [Source code](https://github.com/payloadcms/payload/tree/main/packages/plugin-import-export)
- [Documentation](https://payloadcms.com/docs/plugins/import-export)
- [Documentation source](https://github.com/payloadcms/payload/tree/main/docs/plugins/import-export.mdx)
npm package: @payloadcms/plugin-mcp
Description: MCP (Model Context Protocol) capabilities with Payload
Author: Payload
Latest version: 3.82.1

# Payload MCP Plugin

A plugin for [Payload](https://github.com/payloadcms/payload). This plugin adds [Model Context Protocol](https://modelcontextprotocol.io/docs/getting-started/intro) capabilities.

- [Source code](https://github.com/payloadcms/payload/tree/main/packages/plugin-mcp)
- [Documentation](https://payloadcms.com/docs/plugins/mcp)
- [Documentation source](https://github.com/payloadcms/payload/tree/main/docs/plugins/mcp.mdx)
npm package: @payloadcms/plugin-nested-docs
Description: The official Nested Docs plugin for Payload
Author: Payload
Latest version: 3.82.1

# Payload Nested Docs Plugin

A plugin for [Payload](https://github.com/payloadcms/payload) to easily nest the documents of your application inside of one another.

- [Source code](https://github.com/payloadcms/payload/tree/main/packages/plugin-nested-docs)
- [Documentation](https://payloadcms.com/docs/plugins/nested-docs)
- [Documentation source](https://github.com/payloadcms/payload/tree/main/docs/plugins/nested-docs.mdx)
npm package: @payloadcms/plugin-otp
Description: A blank template to get started with Payload 3.0
Latest version: 0.1.1

# Payload One-time Password Plugin Tutorial

This repository demonstrates how to build a well-structured and advanced plugin that allows for one-time login. It showcases how to do many things:

- Build a bulletproof Payload plugin structure that follows best practices
- Promote plugin type safety and add developer-friendly JSDocs to the plugin options 
- Add new operations, surfaced via local API functions, REST endpoints, and GraphQL mutations
- Extend Payload authentication while reusing existing functionality
- Build an pattern into a plugin for extending its internal logic further, following familiar Payload practices
- Properly export plugin utilities in case developers want to re-use them in their own code
- Build and publish an NPM package
- Set up an integration test suite that ensures the plugin has great test coverage
- Set up E2E tests that show how to test admin-specific functionality added to Payload
npm package: @payloadcms/plugin-search
Description: Search plugin for Payload
Author: Payload
Latest version: 3.82.1

# Payload Search Plugin

A plugin for [Payload](https://github.com/payloadcms/payload) to generate records of your documents that are extremely fast to search on.

- [Source code](https://github.com/payloadcms/payload/tree/main/packages/plugin-search)
- [Documentation](https://payloadcms.com/docs/plugins/search)
- [Documentation source](https://github.com/payloadcms/payload/tree/main/docs/plugins/search.mdx)
npm package: @payloadcms/plugin-sentry
Description: Sentry plugin for Payload
Author: Payload
Latest version: 3.82.1

# Payload Sentry Plugin

This plugin allows you to integrate [Sentry](https://sentry.io/) seamlessly with your [Payload](https://github.com/payloadcms/payload) application.

- [Source code](https://github.com/payloadcms/payload/tree/main/packages/plugin-sentry)
- [Documentation](https://payloadcms.com/docs/plugins/sentry)
- [Documentation source](https://github.com/payloadcms/payload/tree/main/docs/plugins/sentry.mdx)
npm package: @payloadcms/plugin-seo
Description: SEO plugin for Payload
Author: Payload
Latest version: 3.82.1

# Payload SEO Plugin

A plugin for [Payload](https://github.com/payloadcms/payload) to manage SEO metadata from within your admin panel.

If you're using version 2.0.0 or higher of this plugin, you'll need to be using version 2.7.0 or higher of Payload.

If you're still on an older payload version, please use version 1.0.15.

- [Source code](https://github.com/payloadcms/payload/tree/main/packages/plugin-seo)
- [Documentation](https://payloadcms.com/docs/plugins/seo)
- [Documentation source](https://github.com/payloadcms/payload/tree/main/docs/plugins/seo.mdx)
npm package: @payloadcms/plugin-stripe
Description: Stripe plugin for Payload
Author: Payload
Latest version: 3.82.1

# Payload Stripe Plugin

A plugin for [Payload](https://github.com/payloadcms/payload) to connect [Stripe](https://stripe.com) and Payload.

- [Source code](https://github.com/payloadcms/payload/tree/main/packages/plugin-stripe)
- [Documentation](https://payloadcms.com/docs/plugins/stripe)
- [Documentation source](https://github.com/payloadcms/payload/tree/main/docs/plugins/stripe.mdx)
npm package: @payloadcms/plugin-zapier
Description: The Payload plugin for Zapier
Latest version: 0.0.9

# Payload Zapier Plugin

This plugin can be added to a Payload project to make it simple to send Zaps to a zapier webhook address when collection data changes. It is designed to be flexible and generic to allow for all use-cases to manage zaps.

### How it works
When a collection is created/updated/deleted, the plugin will send a Zap to the webhook address. The Zap will contain the collection name, the operation (create/update/delete), and the data related to the document.

We recommend starting with the Zapier Paths + Webhooks template to get started. [See here](https://zapier.com/apps/paths/integrations/webhook). Using Paths, will allow you to handle many different types of data and operations coming from Payload.

### Requirements

- A Zapier account with 1 webhook configured. [More](https://zapier.com/help/create/code-webhooks/trigger-zaps-from-webhooks)
- A Payload project

## Plugin Config Example


```ts
/* file: payload.config.ts */

import { buildConfig } from 'payload/config'
import path from 'path'
import Users from './collections/Users'
import { zapierPlugin } from '@payloadcms/plugin-zapier'

export default buildConfig({
  // ...rest of your config goes here
  plugins: [
    zapierPlugin({
      collections: ['posts'],
      webhookURL: 'https://hooks.zapier.com/hooks/catch/123456/abcdef/',
      enabled: async req => {
        // -- -- -- -- -- -- -- -- -- -- -- -- -- -- -- -- -- -- -- -- -- --
        // `enabled` can be a boolean OR a function that returns a boolean.
        //
        // if it is a function, it will be passed the following arguments:
        //  - all arguments from the hook that triggered the Zap
        //  - operation (create/update/delete)
        // -- -- -- -- -- -- -- -- -- -- -- -- -- -- -- -- -- -- -- -- -- --
        return req.user.role === 'admin'
      },
    }),
  ],
})
```
This plugin is configurable to work across many different Payload collections. A * denotes that the property is required. [Types file](./src/types.ts).
| Option                        | Description |
| ----------------------------- | ----------- |
| **`collections`***            | Array of collection slugs that will  send data to Zapier. `["*"]` can be used to zap every collection. |
| **`webhookURL`***             | Zapier webhook URL to send events to. |
| **`enabled`**                 | Function or boolean value that is checked before a Zap is sent. |

## Features

**Send Zaps**
Allows for events to be sent to Zapier when a specified collection is updated or deleted.

#### Webhook Data

The data sent to the Zapier webhook URL will include:

1. The `collection` slug that triggered the zap.
1. The `operation` used, one of: 'create', 'update', or 'delete'.
1. The `data` object, which is the Payload document that was created, updated, or deleted.
npm package: @payloadcms/richtext-lexical
Description: The officially supported Lexical richtext adapter for Payload
Author: Payload
Latest version: 3.82.1

# Payload Lexical Rich Text Editor

Lexical Rich Text Editor for [Payload](https://payloadcms.com).

- [Main Repository](https://github.com/payloadcms/payload)
- [Payload Docs](https://payloadcms.com/docs)

## Installation

```bash
npm install @payloadcms/richtext-lexical
```

## Usage

```ts
import { buildConfig } from 'payload'
import { lexicalEditor } from '@payloadcms/richtext-lexical'

export default buildConfig({
  editor: lexicalEditor({}),
  // ...rest of config
})
```

More detailed usage can be found in the [Payload Docs](https://payloadcms.com/docs/configuration/overview).
npm package: @payloadcms/richtext-slate
Description: The officially supported Slate richtext adapter for Payload
Author: Payload
Latest version: 3.82.1

# Payload Slate Rich Text Editor

Slate Rich Text Editor for [Payload](https://payloadcms.com).

- [Main Repository](https://github.com/payloadcms/payload)
- [Payload Docs](https://payloadcms.com/docs)

## Installation

```bash
npm install @payloadcms/richtext-slate
```

## Usage

```ts
import { buildConfig } from 'payload'
import { slateEditor } from '@payloadcms/richtext-slate'

export default buildConfig({
  editor: slateEditor({}),
  // ...rest of config
})
```

More detailed usage can be found in the [Payload Docs](https://payloadcms.com/docs/configuration/overview).
npm package: @payloadcms/storage-azure
Description: Payload storage adapter for Azure Blob Storage
Author: Payload
Latest version: 3.82.1

# Azure Blob Storage for Payload

This package provides a simple way to use [Azure Blob Storage](https://azure.microsoft.com/en-us/products/storage/blobs) with Payload.

**NOTE:** This package removes the need to use `@payloadcms/plugin-cloud-storage` as was needed in Payload 2.x.

## Installation

```sh
pnpm add @payloadcms/storage-azure
```

## Usage

- Configure the `collections` object to specify which collections should use the Azure Blob 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.
- When deploying to Vercel, server uploads are limited with 4.5MB. Set `clientUploads` to `true` to do uploads directly on the client. You must allow CORS PUT method to your website.

```ts
import { azureStorage } from '@payloadcms/storage-azure'
import { Media } from './collections/Media'
import { MediaWithPrefix } from './collections/MediaWithPrefix'

export default buildConfig({
  collections: [Media, MediaWithPrefix],
  plugins: [
    azureStorage({
      collections: {
        media: true,
        'media-with-prefix': {
          prefix,
        },
      },
      allowContainerCreate: process.env.AZURE_STORAGE_ALLOW_CONTAINER_CREATE === 'true',
      baseURL: process.env.AZURE_STORAGE_ACCOUNT_BASEURL,
      connectionString: process.env.AZURE_STORAGE_CONNECTION_STRING,
      containerName: process.env.AZURE_STORAGE_CONTAINER_NAME,
    }),
  ],
})
```

### Configuration Options

| Option                 | Description                                                              | Default |
| ---------------------- | ------------------------------------------------------------------------ | ------- |
| `enabled`              | Whether or not to enable the plugin                                      | `true`  |
| `collections`          | Collections to apply the Azure Blob adapter to                           |         |
| `allowContainerCreate` | Whether or not to allow the container to be created if it does not exist | `false` |
| `baseURL`              | Base URL for the Azure Blob storage account                              |         |
| `connectionString`     | Azure Blob storage connection string                                     |         |
| `containerName`        | Azure Blob storage container name                                        |         |
| `clientUploads`        | Do uploads directly on the client to bypass limits on Vercel.            |         |
npm package: @payloadcms/storage-gcs
Description: Payload storage adapter for Google Cloud Storage
Author: Payload
Latest version: 3.82.1

# Google Cloud Storage for Payload

This package provides a simple way to use [Google Cloud Storage](https://cloud.google.com/storage) with Payload.

**NOTE:** This package removes the need to use `@payloadcms/plugin-cloud-storage` as was needed in Payload 2.x.

## Installation

```sh
pnpm add @payloadcms/storage-gcs
```

## Usage

- Configure the `collections` object to specify which collections should use the Google Cloud 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.
- When deploying to Vercel, server uploads are limited with 4.5MB. Set `clientUploads` to `true` to do uploads directly on the client. You must allow CORS PUT method for the bucket to your website.

```ts
import { gcsStorage } from '@payloadcms/storage-gcs'
import { Media } from './collections/Media'
import { MediaWithPrefix } from './collections/MediaWithPrefix'

export default buildConfig({
  collections: [Media, MediaWithPrefix],
  plugins: [
    gcsStorage({
      collections: {
        media: true,
        'media-with-prefix': {
          prefix,
        },
      },
      bucket: process.env.GCS_BUCKET,
      options: {
        apiEndpoint: process.env.GCS_ENDPOINT,
        projectId: process.env.GCS_PROJECT_ID,
      },
    }),
  ],
})
```

### Configuration Options

| Option        | Description                                                                                         | Default   |
| ------------- | --------------------------------------------------------------------------------------------------- | --------- |
| `enabled`     | Whether or not to enable the plugin                                                                 | `true`    |
| `collections` | Collections to apply the storage to                                                                 |           |
| `bucket`      | The name of the bucket to use                                                                       |           |
| `options`     | Google Cloud Storage client configuration. See [Docs](https://github.com/googleapis/nodejs-storage) |           |
| `acl`         | Access control list for files that are uploaded                                                     | `Private` |
npm package: @payloadcms/storage-s3
Description: Payload storage adapter for Amazon S3
Author: Payload
Latest version: 3.82.1

# S3 Storage for Payload

This package provides a simple way to use S3 with Payload.

**NOTE:** This package removes the need to use `@payloadcms/plugin-cloud-storage` as was needed in Payload 2.x.

## Installation

```sh
pnpm add @payloadcms/storage-s3
```

## Usage

- Configure the `collections` object to specify which collections should use the AWS S3 adapter. The slug _must_ match one of your existing collection slugs.
- The `config` object can be any [`S3ClientConfig`](https://docs.aws.amazon.com/AWSJavaScriptSDK/v3/latest/client/s3) object (from [`@aws-sdk/client-s3`](https://github.com/aws/aws-sdk-js-v3)). _This is highly dependent on your AWS setup_. Check the AWS documentation for more information.
- When enabled, this package will automatically set `disableLocalStorage` to `true` for each collection.
- When deploying to Vercel, server uploads are limited with 4.5MB. Set `clientUploads` to `true` to do uploads directly on the client. You must allow CORS PUT method for the bucket to your website.
- Configure `signedDownloads` (either globally of per-collection in `collections`) to use [presigned URLs](https://docs.aws.amazon.com/AmazonS3/latest/userguide/using-presigned-url.html) for files downloading. This can improve performance for large files (like videos) while still respecting your access control. Additionally, with `signedDownloads.shouldUseSignedURL` you can specify a condition whether Payload should use a presigned URL, if you want to use this feature only for specific files.

```ts
import { s3Storage } from '@payloadcms/storage-s3'
import { Media } from './collections/Media'
import { MediaWithPrefix } from './collections/MediaWithPrefix'

export default buildConfig({
  collections: [Media, MediaWithPrefix],
  plugins: [
    s3Storage({
      collections: {
        media: true,
        'media-with-prefix': {
          prefix,
        },
        'media-with-presigned-downloads': {
          // Filter only mp4 files
          signedDownloads: {
            shouldUseSignedURL: ({ collection, filename, req }) => {
              return filename.endsWith('.mp4')
            },
          },
        },
      },
      bucket: process.env.S3_BUCKET,
      config: {
        credentials: {
          accessKeyId: process.env.S3_ACCESS_KEY_ID,
          secretAccessKey: process.env.S3_SECRET_ACCESS_KEY,
        },
        region: process.env.S3_REGION,
        // ... Other S3 configuration
      },
    }),
  ],
})
```

### Configuration Options

See the the [AWS SDK Package](https://github.com/aws/aws-sdk-js-v3) and [`S3ClientConfig`](https://docs.aws.amazon.com/AWSJavaScriptSDK/v3/latest/client/s3) object for guidance on AWS S3 configuration.
npm package: @payloadcms/storage-uploadthing
Description: Payload storage adapter for uploadthing
Author: Payload
Latest version: 3.82.1

# Uploadthing Storage for Payload (beta)

This package provides a way to use [uploadthing](https://uploadthing.com) with Payload.

## Installation

```sh
pnpm add @payloadcms/storage-uploadthing
```

## Usage

- Configure the `collections` object to specify which collections should use uploadthing. The slug _must_ match one of your existing collection slugs and be an `upload` type.
- Get an API key from Uploadthing and set it as `apiKey` in the `options` object.
- `acl` is optional and defaults to `public-read`.
- When deploying to Vercel, server uploads are limited with 4.5MB. Set `clientUploads` to `true` to do uploads directly on the client.

```ts
export default buildConfig({
  collections: [Media],
  plugins: [
    uploadthingStorage({
      collections: {
        media: true,
      },
      options: {
        token: process.env.UPLOADTHING_TOKEN,
        acl: 'public-read',
      },
    }),
  ],
})
```
npm package: @payloadcms/storage-vercel-blob
Description: Payload storage adapter for Vercel Blob Storage
Author: Payload
Latest version: 3.82.1

# Vercel Blob Storage for Payload

This package provides a simple way to use [Vercel Blob](https://vercel.com/docs/storage/vercel-blob) storage with Payload.

**NOTE:** This package removes the need to use `@payloadcms/plugin-cloud-storage` as was needed in Payload 2.x.

## Installation

```sh
pnpm add @payloadcms/storage-vercel-blob
```

## Usage

- Configure the `collections` object to specify which collections should use the Vercel Blob adapter. The slug _must_ match one of your existing collection slugs.
- Ensure you have `BLOB_READ_WRITE_TOKEN` set in your Vercel environment variables. This is usually set by Vercel automatically after adding blob storage to your project.
- When enabled, this package will automatically set `disableLocalStorage` to `true` for each collection.
- When deploying to Vercel, server uploads are limited with 4.5MB. Set `clientUploads` to `true` to do uploads directly on the client.

```ts
import { vercelBlobStorage } from '@payloadcms/storage-vercel-blob'
import { Media } from './collections/Media'
import { MediaWithPrefix } from './collections/MediaWithPrefix'

export default buildConfig({
  collections: [Media, MediaWithPrefix],
  plugins: [
    vercelBlobStorage({
      enabled: true, // Optional, defaults to true
      // Specify which collections should use Vercel Blob
      collections: {
        media: true,
        'media-with-prefix': {
          prefix: 'my-prefix',
        },
      },
      // Token provided by Vercel once Blob storage is added to your Vercel project
      token: process.env.BLOB_READ_WRITE_TOKEN,
    }),
  ],
})
```

| Option               | Description                                                          | Default                       |
| -------------------- | -------------------------------------------------------------------- | ----------------------------- |
| `enabled`            | Whether or not to enable the plugin                                  | `true`                        |
| `collections`        | Collections to apply the Vercel Blob adapter to                      |                               |
| `addRandomSuffix`    | Add a random suffix to the uploaded file name in Vercel Blob storage | `false`                       |
| `cacheControlMaxAge` | Cache-Control max-age in seconds                                     | `365 * 24 * 60 * 60` (1 Year) |
| `token`              | Vercel Blob storage read/write token                                 | `''`                          |
| `clientUploads`      | Do uploads directly on the client to bypass limits on Vercel         |                               |