nextjs-notion-starter-kit icon indicating copy to clipboard operation
nextjs-notion-starter-kit copied to clipboard

Alternative to next-api-og-image for social image generation

Open FranciscoMoretti opened this issue 3 years ago • 0 comments

Description

The dependency of next-api-og-image and subsequently, of chrome-aws-lambda can be a bit problematic. My Vercel builds were reporting that the compressed serverless function was a bit over the limit (50.1mb > 50mb limit).

I wonder if there is a plan to replace it with something else.

Cloudinary alternative

I've implemented automatic image generation with https://cloudinary.com/. I've combined this repository with the method from this post https://delba.dev/blog/next-blog-generate-og-image. There is a free plan that could be useful for most people. However, I understand that it's not ideal because it requires some configuration (creating an account, uploading an image, etc).

Example

  • In this repository you can see the modifications to the social-image API.
  • Working API generates social-images like this one: https://www.franciscomoretti.com/api/social-image?id=b0405f73-026a-46a3-84ae-170c5918f8e7

Actions

I can create a PR to include Cloudinary as a replacement or an alternative. I'm not sure if that's desired though. There might be a better option that directly replaces chrome-aws-lambda. I'd be happy to work on that replacement if it exists.

P.S.: Thanks for this awesome repo!

FranciscoMoretti avatar Aug 12 '22 10:08 FranciscoMoretti