Unlock seamless workflows and faster delivery with our latest releases - Join the deep dive

Attaching images to Sanity editor using generated blobs

5 replies
Last updated: Oct 8, 2020
Hello folks, I'm wondering if it's possible to attach on the editor a blob as an actual image?What I'm thinking of is...

1. On the editor, I put a title and a description
2. There is a button called "Generate og:image"
3. If I click it, it creates a blob of image on the browser
4. It is attached as an actual image
5. It will be uploaded to sanity cdn.
6. During the build time (or on the server) the url is used for 'og:image' tag.

I'm curious about (4). I might need to dig more into sources of image type. But has anyone done something similar already?

https://www.sanity.io/docs/image-type#sources-d82cf03b063c
Oct 4, 2020, 9:46 AM
Oh awesome. I'll watch it now. Thanks šŸ˜Š
Oct 4, 2020, 9:54 AM
Exactly what I was looking for šŸ‘
Oct 4, 2020, 9:56 AM
user S
let me know if that helps. I need to create some offciial docmumentation around this
Oct 8, 2020, 7:13 PM
Hey it helped a lot! Inspired by you, I'm having a slightly different approach. I'm hosting sanity studio on vercel and created an api which generates image using puppeteer and set the image to the document using sanity client šŸ™‚
So the frontend of the studio just calls the api with
id, title, description
.
Oct 8, 2020, 7:15 PM

Sanityā€“ build remarkable experiences at scale

Sanity is a modern headless CMS that treats content as data to power your digital business. Free to get started, and pay-as-you-go on all plans.

Was this answer helpful?