I want to create a fully adaptive store so that it can be shoved into absolutely any game and it works.
So, I need to get all the gamepasses and dev products somehow. Looking at the MarketplaceService I noticed a method: GetDeveloperProductsAsync - this solved the problem with dev products, but reading further I didn’t find anything similar for gamepasses. That’s actually the point of the question, how can I get all gamepasses in the game where the script is currently located?
I don’t think that there’s a built-in way to do it which doesn’t rely on external APIs.
Also the way provided in the topic that is referenced is paginated, meaning that if you want to get all the passes(and not just the first 100 ones) you need to make multiple requests using the cursors of the previous ones(until a cursor isn’t returned).
If you’re scared regarding the proxy you can have a few safeguards tho. For example you can make it not run during studio testing, so it can’t IP grab you, and also you can make it only return the gamepasses ids(instead of their associated info as well).
Then you verify said ids by passing them through MarketplaceService(that you do trust) and check if the owner/creator of the gamepasses is equal to the owner/creator of the game. Those requests will also return the gamepasses data(name, description, etc) so you can load it from there(which is a trusted source).
Alternatively you can make an array of gamepass ids that the creator has to manually fill in, although that might add in a bit of unnecessary work.