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

Highlighted
Shopify Partner
28 0 9

Hi, this question was asked before, but was never answered. I'm creating an app that uses an applicaiton proxy link. I need to be able to reference this link for AJAX calls, but I cannot rely on the link matching what I set up in my app settings since store owners have the option to edit the url that they use. How can I access the url value that a store is using for my app?

 

Store owners may choose to change the sub-path so that the URL in the location bar makes the proxy page appear like it is being hosted in their store instead of externally. Ultimately, the sub-path is purely for shop aesthetics and will not affect the actual location of the proxy URL (edited sub-paths will still be forwarded to the proxy URL).

3 Likes
Shopify Expert
3994 14 321

BUMP!

As I create the same pattern as Mr Mackay here I have the same issue. I can set up my App Proxy to work perfect, as /tools or /apps or /a or /community. But as soon as the merchant changes from one to the other, all the JS in the theme no longer points as the right address. 

Either you allow the merchant to change URL and allow that change to propagate through a Liquid parameter (if possible), or you send an alert to the App via a webhook so it can re-inject new script code that works with the change. 

Leaving the current App Proxy in this state degrades the use case possibilities severely for any App Proxy installed in a general App. 

Custom Shopify Apps built just for you! hunkybill@gmail.com http://www.resistorsoftware.com
2 Likes
Shopify Partner
28 0 9

One awesome thing about the App Proxy, which is part of the reason I want to use it, is that you can use it to completely sidestep problems with Cross Origin Resource Sharing in your Javascript. Of course, you should still be authenticating all requests that are made to your app, but this gives you one less complication to worry about.

Another cool thing is that if your App is sending back JSON responses, you can incorporate liquid logic into the response. Based on Andrew's comment at the end of this forum thread, I've been using this ability in an app that I'm developing to verify that each request was made by a logged in customer. If someone were to try to access data from someone else's account by guessing their account ID, the JSON response would be returned as an error message after filtering through the liquid parser.

0 Likes
Shopify Partner
12 0 1

I have the same issue. I'd like to auto-generate URLs for an email to send which would land on the user's proxy page for my app. However, if they change the Proxy URL, then I have no idea where to send the user who's receiving the email.

Dan

0 Likes
Shopify Partner
98 0 16

BUMP

Thanks for bringing this up again.  

We still need to be able to know when a shop changes our proxy url so we can send out the correct location in emails.

0 Likes
Shopify Partner
12 0 1

Is this the best place to get support for the API for Partners? I emailed customer support, they told me to come here, but a large number of these posts seem to rot on the vine...

Dan

0 Likes
Shopify Expert
3994 14 321

You can write emails to support@shopify.com, post here. You can try Twitter feeds too. 

Custom Shopify Apps built just for you! hunkybill@gmail.com http://www.resistorsoftware.com
0 Likes
Shopify Partner
12 0 1

An email to support resulted in a reply that basically said "We don't have the expertise to help you here, post on the forum or StackOverflow." Hopefully one of these two methods gets some results.

 

Dan

0 Likes
Shopify Expert
3994 14 321

Sure.. if your issue is simple SO could help. A lot of chuff blows in the wind there too. Lots of off-topic problems lumped in. 

Custom Shopify Apps built just for you! hunkybill@gmail.com http://www.resistorsoftware.com
0 Likes
Shopify Partner
12 0 1

Yeah. Unfortunately, none of the three questions I've posted here have gotten any results either.

Dan

0 Likes