Kirby 3 images on Amazon S3 bucket

Hi there,

I know there are several related questions here in the forums but I’m still not quite sure how to solve this, as I’m not that familiar with Kirby 3 yet.

I plan to use Kirby as a headless CMS for a nuxt application and will consume the content via the json api. Nuxt will generate a fully static render with the content embedded as local json data. The only link to the kirby installation will be the images though. With Cockpit CMS I solved this by keeping the media folders in sync with an amazon S3 bucket und returning the appropriate S3 urls with the images. Statamic offers more or less the same thing.

Now I’m a bit confused how to achieve that in Kirby 3. For what I found out I could write a custom plugin that hooks into the file.created:after (maybe also on delete & replace) hook and uploads the file to an S3 bucket.

But how to I get Kirby to return the corresponding S3 link when requesting the image?
Can I save the S3 link as a file property or should I replace the whole image url?
How would I do this? As far as I see the hook passes the file object as a parameter, but I can’t alter the file object, or can I?

Thanks in advance :slight_smile:
Dominik

Maybe this helps: Virtual Files for page?