Docs

Getting started

Put this in your page's <head>. Swap in your own URL.

html
<meta property="og:image" content="https://snapog.com/s/https%3A%2F%2Fyoursite.com">

Now when someone drops your link in Slack or tweets it, there's an image.

What's actually happening

We open your page in a browser — a real one, with JavaScript and everything. Then we take what's on screen and fit it into a 1200×630 image.

A few things make the result look better than a raw screenshot:

What doesn't work

Refreshing a cached image

We cache images for about a week. Most of the time that's fine — your page doesn't change that often. But if you need a fresh one right now, there's a way.

You'll generate an Ed25519 keypair, publish the public half on your site, and sign refresh requests with the private half. It's a few commands.

1. Make a keypair

shell
openssl genpkey -algorithm Ed25519 -out snapog_private.pem
openssl pkey -in snapog_private.pem -pubout -out snapog_public.pem

# Get the raw public key as base64
openssl pkey -in snapog_public.pem -pubin -outform DER | tail -c 32 | base64

2. Put the public key on your site

You can serve it as a JSON file at /.well-known/snapog.json:

json
{ "publicKey": "your-base64-public-key-here" }

Or just stick it in a meta tag:

html
<meta name="snapog-key" content="your-base64-public-key-here">

3. Sign your URL and send it

shell
# Sign the exact URL you want refreshed
echo -n "https://yoursite.com/" | openssl pkeyutl -sign -inkey snapog_private.pem | base64 -w0
shell
curl 'https://snapog.com/s/https%3A%2F%2Fyoursite.com?refresh=YOUR_BASE64_SIGNATURE'

If the signature is good, we throw out the old image and make a new one. If it's not, you just get whatever was cached. No error, no fuss.

CLI (coming soon)

We're working on npx snapog so you don't have to do the openssl dance yourself.