Menu
Use Case

Dynamic OG Image Generation

Generate beautiful Open Graph images for every page on your site — automatically, with one API call.

The problem

Static OG images don't scale. Every blog post, product page, and user profile deserves a unique social preview. Creating them manually takes hours. @vercel/og is limited to JSX-in-edge-function — great for Next.js, awkward everywhere else.

The solution

One POST request. Any backend. Any language.

curl -X POST https://api.snapsharp.dev/v1/og-image \
  -H "Authorization: Bearer sk_live_..." \
  -d '{
    "template": "blog-post",
    "data": {
      "title": "My Article Title",
      "author": "Jane Doe",
      "date": "March 25, 2026"
    }
  }' -o og.png

How to integrate in Next.js

Create a route that generates OG images on demand and caches them via the API:

// app/blog/[slug]/opengraph-image.ts
export const runtime = 'edge';

export default async function OGImage({ params }) {
  const post = await getPost(params.slug);
  const res = await fetch(
    'https://api.snapsharp.dev/v1/og-image',
    {
      method: 'POST',
      headers: {
        Authorization: `Bearer ${process.env.SNAPSHARP_KEY}`,
        'Content-Type': 'application/json',
      },
      body: JSON.stringify({
        template: 'blog-post',
        data: { title: post.title, author: post.author },
      }),
    }
  );
  const image = await res.arrayBuffer();
  return new Response(image, {
    headers: { 'Content-Type': 'image/png' },
  });
}