Uploadthing - can't add metadata when uploading files

I see metadata is an option in the docs but its not part of the UploadFilesOptions interface and I'm getting type errors. Docs with metadata as an option https://docs.uploadthing.com/api-reference/ut-api#parameters
const fileData = await utapi.uploadFiles([file], {
metadata: { userId },
});
const fileData = await utapi.uploadFiles([file], {
metadata: { userId },
});
Error: Object literal may only specify known properties, and 'metadata' does not exist in type 'UploadFilesOptions'. Using v7.7.2
UTApi - UploadThing Docs
TypeScript SDK for consuming the UploadThing REST API.
1 Reply
zpg6
zpg6OP5d ago
Still interested in some help here. Works in version 6 not 7

Did you find this page helpful?