Files
payloadcms/packages/storage-uploadthing
Elliot DeNolf 9816787fbf chore: remove all unused imports (#7999)
Removes all unused imports.

Temporarily swapped in
https://github.com/sweepline/eslint-plugin-unused-imports to
differentiate between unused imports and unused vars. The default rule
does not differentiate.
2024-08-30 16:52:08 -04:00
..

Uploadthing Storage for Payload (beta)

This package provides a way to use uploadthing with Payload.

Installation

pnpm add @paylaodcms/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.
export default buildConfig({
  collections: [Media],
  plugins: [
    uploadthingStorage({
      collections: {
        [mediaSlug]: true,
      },
      options: {
        apiKey: process.env.UPLOADTHING_SECRET,
        acl: 'public-read',
      },
    }),
  ],
})