This package provides a way to use uploadthing with Payload.
pnpm add @payloadcms/storage-uploadthing
- Configure the
collections
object to specify which collections should use uploadthing. The slug must match one of your existing collection slugs and be anupload
type. - Get an API key from Uploadthing and set it as
apiKey
in theoptions
object. -
acl
is optional and defaults topublic-read
. - When deploying to Vercel, server uploads are limited with 4.5MB. Set
clientUploads
totrue
to do uploads directly on the client.
export default buildConfig({
collections: [Media],
plugins: [
uploadthingStorage({
collections: {
media: true,
},
options: {
token: process.env.UPLOADTHING_TOKEN,
acl: 'public-read',
},
}),
],
})