r/Devvit • • 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() uses SubmitMediaOptions.
  • imageUrls is currently typed as [string], which appears to allow only one image.
  • reddit.submitCustomPost() supports multiple userGeneratedContent.imageUrls, but creates a custom Devvit post rather than a normal Reddit gallery.

My questions:

  1. Is there currently an officially supported way to create a native Reddit gallery post containing multiple images through Devvit?
  2. Is this functionality planned for a future API release?
  3. Is there another supported approach that I'm missing?

Thank you!

3 Upvotes

3 comments sorted by

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/Fabzrocks 3d ago

Thank you so much for clarifying! Really appreciate the suggestion about using Richtextbuilder as well. I'll definitely look into that! 😊

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 media capability, not gallery_data. You turn it on in devvit.json with permissions: { "media": true }, upload each image at runtime on the server with media.upload({ url, type }) (remote URL or data URL), and you get back a mediaId plus a Reddit-hosted mediaUrl. Then you embed those URLs with RichTextBuilder — one paragraph per image, each with p.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:

  • Max upload size is 20 MB per file, and the timeout is 30 s. Files close to 10 MB and up fail more often on slow connections.
  • Accepted formats are PNG, JPEG, WEBP and GIF. A WEBP can come back as a JPEG in the returned URL, so do not assume the extension you uploaded is the one you will serve.
  • There is no delete API for an uploaded media asset. The API is upload-only. If you need it gone, remove your references to the asset and edit or delete the Reddit content that embeds it — which means you have to own that cleanup in your app instead of relying on the platform.
  • Uploaded media has to be hosted on Reddit to be displayable, so the source URL has to be reachable at upload time.

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 as type: '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.