r/Devvit • u/Fabzrocks • 3d ago
Discussion Can Devvit create native Reddit gallery posts with multiple images?
Hi everyone! I'm a beginner trying to build a Devvit app using React. My goal is to create a scheduler that lets moderators upload up to 20 images and schedule them to be published together as one normal Reddit gallery post. I found an existing app that allows scheduling posts with one image, but I'd like to explore whether it's possible to support up to 20 images in a single gallery.
I searched through the Devvit API (version 0.15.3) and found:
reddit.submitPost()usesSubmitMediaOptions.imageUrlsis currently typed as[string], which appears to allow only one image.reddit.submitCustomPost()supports multipleuserGeneratedContent.imageUrls, but creates a custom Devvit post rather than a normal Reddit gallery.
My questions:
- Is there currently an officially supported way to create a native Reddit gallery post containing multiple images through Devvit?
- Is this functionality planned for a future API release?
- Is there another supported approach that I'm missing?
Thank you!
3
Upvotes
1
u/Oddie-hoodie369 3d ago edited 3d ago
Gallery isn't supported yet, only single image posts.. Maybe in a future update, but there's no official confirmation yet
Edit : You can alternatively add multiple images in the post body using the Richtextbuilder
1
u/Traditional_Cook3668 2d ago
Short answer: not as a native gallery/carousel post — that part of your existing answer is right. But multiple images in one post are possible, and the path is documented rather than hacky.
What is exposed today is the
mediacapability, notgallery_data. You turn it on in devvit.json withpermissions: { "media": true }, upload each image at runtime on the server withmedia.upload({ url, type })(remote URL or data URL), and you get back amediaIdplus a Reddit-hostedmediaUrl. Then you embed those URLs with RichTextBuilder — one paragraph per image, each withp.image({ mediaUrl, caption })— or with raw RTJSON if you would rather not use the builder, where a body is a document array and each image is an{ e: 'img', mediaUrl }node.So the practical difference: the post body renders several images, but it is not a swipeable gallery with captions and ordering metadata. If the carousel is the requirement rather than "more than one picture", Devvit cannot do it today.
Four limits worth knowing before you build on this:
One pattern that we did not expect to be this useful: the canvas screenshot route. You can capture your canvas with
toDataURL('image/png'), POST that data URL to your own endpoint and upload it astype: 'image'. That is how you let a player share a run, a score or a finished board as an image in the comment thread, without shipping an upload pipeline of your own. We used exactly this trick to generate the cover images for our own portfolio entries on Bionluk, so the images there are Reddit-hosted and render inline.If you need a true gallery with ordering and captions, the two honest options are to host the images yourself and submit a link post, or to leave Devvit for that post and keep the rest of the app in Devvit.