You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
I'm building terrain-viewer, a pure frontend app that generates dynamic visual content (e.g. a terrain generator using canvas). When users want to share their current view to socials, they need a short URL whose link preview reflects a screenshot of the current state.
Zipline already does both pieces independently:
POST /api/upload → returns a public image URL
POST /api/shorten → creates a short URL
But there's no way to associate an uploaded image with a short URL so that the shortened link renders that image as its og:image in social previews.
Proposed change
Allow an optional ogImage field on POST /api/shorten, referencing either:
A Zipline-hosted file URL (from a prior upload), or
Any external URL
bonus point if one can pass directly the base64 image, which would first upload to zipline storage, then adds as url og-media metadata.
When someone visits the short URL, Zipline renders an intermediate HTML page with correct og:image, og:title, og:description meta tags before the JS redirect, ensuring social crawlers pick up the custom preview.
Why this matters
Social crawlers (Twitter/X, LinkedIn, Facebook, Slack, Discord, WhatsApp) fetch OG metadata within seconds to minutes of a link being shared. This is a one-time crawl per URL — the image does not need to be stored permanently. Even a short TTL upload (e.g. 30 minutes) would be sufficient for crawlers.
Ideal one-call flow
POST /api/shorten
{
"url": "https://myapp.com?params=xyz",
"ogImage": "https://zipline.mydomain.com/u/terrain_preview.png",
"ogTitle": "My Generated Terrain",
"ogDescription": "Check out this terrain I generated!"
}
→ { "shortUrl": "https://zipline.mydomain.com/s/abc123" }
Alternatives considered
Using separate services (imgbb + dub.co) — works but adds two API keys and two round trips to an otherwise self-hosted setup
Cloudflare Workers — viable but adds infrastructure complexity
reacted with thumbs up emoji reacted with thumbs down emoji reacted with laugh emoji reacted with hooray emoji reacted with confused emoji reacted with heart emoji reacted with rocket emoji reacted with eyes emoji
Uh oh!
There was an error while loading. Please reload this page.
-
Use case
I'm building terrain-viewer, a pure frontend app that generates dynamic visual content (e.g. a terrain generator using canvas). When users want to share their current view to socials, they need a short URL whose link preview reflects a screenshot of the current state.
Zipline already does both pieces independently:
POST /api/upload→ returns a public image URLPOST /api/shorten→ creates a short URLBut there's no way to associate an uploaded image with a short URL so that the shortened link renders that image as its
og:imagein social previews.Proposed change
Allow an optional
ogImagefield onPOST /api/shorten, referencing either:When someone visits the short URL, Zipline renders an intermediate HTML page with correct
og:image,og:title,og:descriptionmeta tags before the JS redirect, ensuring social crawlers pick up the custom preview.Why this matters
Social crawlers (Twitter/X, LinkedIn, Facebook, Slack, Discord, WhatsApp) fetch OG metadata within seconds to minutes of a link being shared. This is a one-time crawl per URL — the image does not need to be stored permanently. Even a short TTL upload (e.g. 30 minutes) would be sufficient for crawlers.
Ideal one-call flow
Alternatives considered
Beta Was this translation helpful? Give feedback.
All reactions