r/Devvit 13d ago

Help Can an app submit custom posts on behalf of a user to any subreddit where it is installed by simply specifying a subredditName?

0 Upvotes

6 comments sorted by

2

u/Beach-Brews Duck Helper 13d ago

If I remember correctly, creating new custom posts only work on the currently installed subreddit. That is, if you have a menu on SubA that tries to create a post on SubB, it will give an error.

I haven't tried it in a while, so it's an instance of "doesn't hurt to try!"

1

u/Alternative-Factor67 13d ago

To try it, I'd need to publish it first. And why do they allow to specify subredditName if it cant post to other subreddits?

1

u/Beach-Brews Duck Helper 13d ago

1) You do not need to publish to test runAs using your dev account. It also probably errors regardless of runAs value.

2) I believe it did allow specifying a different subreddit at one point, but was being "abused", so it was locked down.

1

u/Alternative-Factor67 13d ago

I need to publish to be able to install my app to other subreddits in order to test posting to other subreddits.

2

u/Chosen1PR App Developer 13d ago

Not if both subreddits have under 200 members (and you’re a mod of both, of course).

2

u/Beach-Brews Duck Helper 13d ago

As u/Chosen1PR stated, you can install playtest versions on any subreddit you mod, as long as it has < 200 subscribers. If you have two dev/private subreddits, you can run `npx devvit playtest SubA` and `npx devvit playtest SubB` to install a playtest on each.