How to get the public app proxy URL? Using GraphQL?

Hello Team,
Is the App Proxy public URL (/apps/{proxy-path}) available via GraphQL or REST API?

If not, is manually constructing the URL using the shop domain and proxy path the recommended approach?

Please confirm if the App Proxy configuration is intentionally not exposed via API.

Thanks.

Hi @WebcontriveApps! The app proxy configuration isn’t exposed via GraphQL or REST API - this is by design. Your app already knows its own prefix and subpath from your shopify.app.toml, so constructing the URL manually is the expected approach.

The format is straightforward: https://{shop-domain}/{prefix}/{subpath}

One thing to keep in mind is that merchants can customize the prefix and subpath after installation via Settings > Apps and sales channels > {your app} > App proxy.

If you need to account for this, a path_prefix query parameter is included in every proxied request to your app (e.g., path_prefix=%2Fapps%2Fsubscription-customer). You could capture and store this value on the first proxy request if you need the merchant’s actual configured path.

For most use cases though, just using your configured values from the TOML should be fine since merchants rarely change the defaults.

We’ve experienced this before and it’s a pain point. It’s honestly puzzling why Shopify doesn’t expose this in either the API (or ideally in the app extension Liquid). @Donal-Shopify I realize that they provide a path_prefix param in the request but the origin of that initial request is the problem. Let’s say a merchant changes this value (or more likely another app conflicts), how are you supposed to know where to send a user? In this case we’d never get a request to begin with and thus the problem remains.

2 Likes

Hey @Nick_Mealey, that’s a very valid point. The path_prefix approach only helps after you’ve received a proxy request.

I’ve raised this as feedback internally - exposing the configured proxy path via the Admin API would be a reasonable solution to this. I’ll update this thread if I hear anything back - thanks for bringing this up!

1 Like

Thanks for the reply @Donal-Shopify . For our use case having a variable within the app Liquid object would be the most ideal case. Second to that would be via the Storefront API and third being the Admin API.

1 Like