Added new example tasks (FFmpeg / Sharp / Vercel AI SDK)#1312
Conversation
|
|
|
||
| ## Adding the FFmpeg build extension | ||
|
|
||
| To use these example tasks, you'll first need to add our FFmpeg extension to your project configuration like this: |
There was a problem hiding this comment.
Should probably mention the need to add @trigger.dev/build to your devDependencies if it already isn't there (init will now add it).
| import path from "path"; | ||
|
|
||
| // Initialize S3 client for R2 storage | ||
| const s3Client = new S3Client({ |
There was a problem hiding this comment.
I'd link to this document about how to authenticate to R2: https://developers.cloudflare.com/r2/api/s3/tokens/
commit: |
|
|
||
| ### Task code | ||
|
|
||
| <Warning> |
There was a problem hiding this comment.
Let's give people example URLs they can use
|
|
||
| // Upload the thumbnail to R2 and get the public URL | ||
| await s3Client.send(new PutObjectCommand(uploadParams)); | ||
| const s3Url = `https://${process.env.S3_BUCKET}.s3.amazonaws.com/${s3Key}`; |
There was a problem hiding this comment.
This URL is incorrect, it's pointing to aws, not R2
|
|
||
| export const sharpProcessImage = task({ | ||
| id: "sharp-process-image", | ||
| run: async (payload: { imageUrl: string; watermarkUrl: string }) => { |
There was a problem hiding this comment.
Again, it would be cool to supply some example URLs
No description provided.