<img> inside content and the featured_image_url point at theStacc’s CDN (cdn.thestacc.com), served to your visitors directly. That’s the simplest setup and works out of the box.
For deeper CMS integration, many sites prefer to host blog images on their own storage alongside the rest of their media library. The images array makes that a one-pass mirror with no HTML parsing required.
How it works
Theimages field is a list of {url, alt} objects — one per <img> in the content body, in document order, with duplicates collapsed. Each url is byte-for-byte identical to what’s in the corresponding src= attribute inside content, so a plain string find/replace handles the swap reliably.
Python receiver
Security: allowlist your fetch host
Whenever a server-side handler downloads URLs from any external source, allowlist trusted hosts before issuing the request. For theStacc images, the trusted host iscdn.thestacc.com:
featured_image_url. With it in place, every body and featured image fetches through a single auditable choke point.
Notes
- Featured image is NOT in
images[]. It’s a separate top-level field (featured_image_url). theStacc strips the inline hero fromcontentbefore sending so the page doesn’t render the same image twice. - Duplicate URLs are deduped. If the same body image appears twice, the array lists it once. Your
content.replaceAll(...)swaps every occurrence in one pass anyway. altmay be empty. Decorative images and images the generator didn’t caption ship withalt: "". Pass it through verbatim to preserve accessibility on your re-hosted copy.- Backward compatible. Receivers that ignore
imagescontinue working unchanged — every other field is identical to before this field was added. - The URL is the stable identifier. theStacc does not inject any per-image marker attribute into the
<img>tags. URLs inimages[]mirrorcontentverbatim, so a one-to-one find/replace works without any normalization step.
Migrating blogs already published with theStacc’s URLs
If you have blogs already in your CMS with theStacc CDN URLs and you want to switch them to self-hosted images:- Open each blog in theStacc and click Publish to re-publish.
- The webhook fires as
blog.updatedwith theimagesarray. - Your receiver runs the mirror loop above and updates the post (same
blog_idmeans the same CMS record). - The CMS post now stores your URLs instead of theStacc’s.
