Skip to main content
Creating shareable moments in the Farcaster Mini App is a great way to engage with your users. You can generate custom shareable user specific images in the Farcaster Mini App and make it easy for the user to share them! Example In this guide we setup a dedicated endpoint /api/og for generating images and we use @vercel/og package to generate the images.

Generating images

If you are using the Monad Mini App template, you can simply edit app/api/og/route.tsx to generate images of your choice.
app/api/og/route.tsx
If you are not using the template, you need to install @vercel/og package.
Create a new file app/api/og/route.tsx, if you are using Next.js 14 or higher.
app/api/og/route.tsx
If you are not using Next.js, you can setup an endpoint or dedicated microservice to generate the images.

Sharing images via the Mini App

Example from EGGS Mini App, prompting the user to cast a custom generated image Add shareable elements to your Mini App, so the user can share the generated images via the Mini App. Below is an example of a button that can be used to generate and share a custom image: