A serverless app created with SST that dynamically generates social share or Open Graph (OG) images.
Read the guide on how this service is configured and how you can create your own — Dynamically generate social share images with serverless.
You can also reference the example on using the Chromium Lambda Layer.
Start by installing the dependencies.
$ npm install
Install the @sparticuz/chromium layer.
$ cd layers/chromium && npm install
Then start the Live Lambda Development environment.
$ npx sst start
The templates to generate the share images are stored in templates/
. And all the non-Latin fonts are placed in .fonts/
.
Deploy your service to prod by running.
$ npx sst deploy --stage prod
To clear the cache of generated images, invoke the clear-cache.handler
with the following payload.
{"path":"<template-name>/"}