I think I must be misinterpreting the docs to think that there is a way around a > 4.5MB payload by using a streaming function.
If someone can confirm or set me straight, that would be appeciated.
In the meanwhile, I’ll leave my workaround here in case it might be useful for others facing the same issue.
- Upload the image file to temp storage (e.g. Firebase Storage)
- Call an api with the image path and get the file from storage in the serverless function
- Process the image with Sharp
- Delete the object in storage from step 1
This is an extra step and it takes a little longer, but it does work in production as there is no large payload in the api call.