Content
@
0 reply
0 recast
2 reactions
phil
@phil
What is the best way to compose a dynamic image for use in social sharing? For example, when I share a Warpcast URL to a friend, it generates a preview. How is this done without needing to upload and store an image somewhere?
25 replies
2 recasts
29 reactions
jtgi
@jtgi
satori w/sharp works well - vercel has this built in if you're hosted there (but can get expensive). create the svg then convert to base64 encoded png and return it, roughly like this: ``` const svg = await satori(...) const png = await sharp(Buffer.from(svg)).png().toBuffer().then(buff => buff.toString('base64')) ... ``` i think gpt should recommend from there.
0 reply
0 recast
3 reactions