Get local URL of Application Proxy, even if shop owner changes it

Shopify Partner
27 0 9

Honestly, I wouldn't expect to get any response about this. I have problems going back over 3 years which I've contacted Shopify about multiple times—through the forums, through support, and through twitter—and still they're not addressed. It might be more productive to write your question on a piece of paper and burn it.

If we do get an answer to this, I will happily eat my words :)

Shopify Partner
7 0 1

Ideally, we'd get a notification for a change in proxy url by the shop owner. 

For now, I'd set a preference in your app defaulting to the proxy url you set, then let the shop owner change the that pref if they change their proxy url.

Would it be possible to get the proxy url from a request header in your proxy endpoint? (e.g., referer)

1 Like
Shopify Partner
12 0 1

There's no reason there can't be a webhook post with the new proxy url information when it's updated. Hell, even a way to query the Shopify API to ask what the current proxy URL is before I write out anything for the customer would be sufficient (even if it is brutish).


Shopify Partner
8 0 1

Edit: Nevermind. After the shop owner changes the proxy url, the old proxy url returns a 404 Not Found. How would your app receive a request with the new proxy url?? Silly me.

<del>Get the new proxy from the request params.</del>

Here's a sample log entry from a shopify app's web server receiving a proxy request:

method=GET path="/shopifyproxy/?"

shop: shop's myshopify_domain

path_prefix: the proxy url.

Keep the proxy url somewhere in your db — ideally a column in a model you already query upon proxy request. If path_prefix is different than the proxy url in your db, update it.

That's the best app developers can do for now.

Shopify Partner
17 0 1

Another vote to fix this problem. I think I may just put a warning on my app that says the app will break if they change the proxy URL.

I understand the rationale of allowing the store owner to set their own URL, but for some apps this doesn't make sense. The app developer should be able to toggle on/off whether the store owner can change it or not.

Shopify Expert
3933 15 323

@Lucas, this is not a server side problem. It is all about the client. If the merchant changes the prefix, the client-side JS is useless. 

So either Shopify informs an App of this change, so the App can then adjust the JS (clunky), or Shopify does away with a feature I bet NO ONE uses. Who really cares what the prefix is. My guess is that its a "You think they might need this, but they really don't" legacy. 

Custom Shopify Apps built just for you!