Skip to content
Open
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
2 changes: 1 addition & 1 deletion packages/storage-uploadthing/README.md
Original file line number Diff line number Diff line change
Expand Up @@ -11,7 +11,7 @@ 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.
- Get an API key from Uploadthing and set it as `apiKey` in the `options` object. **Note: This plugin expects a key in JWT format**. Make sure the token you copy from the Uploadthing dashboard starts with `ey` and not `sk_`.
- `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.

Expand Down
2 changes: 2 additions & 0 deletions packages/storage-uploadthing/src/handleUpload.ts
Original file line number Diff line number Diff line change
Expand Up @@ -40,9 +40,11 @@ export const getHandleUpload = ({ acl, utApi }: HandleUploadArgs): HandleUpload

if (foundSize) {
data.sizes[foundSize]._key = res.data?.key
data.sizes[foundSize].url = res.data?.url
} else {
data._key = res.data?.key
data.filename = res.data?.name
data.url = res.data?.url
}

return data
Expand Down
6 changes: 3 additions & 3 deletions packages/storage-uploadthing/src/index.ts
Original file line number Diff line number Diff line change
Expand Up @@ -106,9 +106,9 @@ export const uploadthingStorage: UploadthingPlugin =
...(collOptions === true ? {} : collOptions),

// Disable payload access control if the ACL is public-read or not set
// ...(uploadthingStorageOptions.options.acl === 'public-read'
// ? { disablePayloadAccessControl: true }
// : {}),
...(uploadthingStorageOptions.options.acl === 'public-read'
? { disablePayloadAccessControl: true }
: {}),

adapter,
},
Expand Down