Any suggestions would be greatly appreciated.
For anybody else reading this in the future with the same problem.
The answer is to use shopify app proxies, https://shopify.dev/apps/online-store/app-proxies
a rough outline of the steps I took to do this.
I don't really know but the way I got it to work was just by putting the ngrok url (APP URL) in the App Proxy proxy url field in the APP SETUP panel. in the subpath prefix I put apps and in the subpath field I put the app name. That worked for me and I am able to send data from the theme-app-extensions to the backend api route and save the data into the database and retrieve that data for the shopify admin area dashboard. Let me know if this helps or not.
Hello Jameshagood, your answers are very helpful.
The ngrok URL changes frequently, do you update the APP URL manually? If not, how do you handle this change? Do you think using the ngrok URL would work in production?
yes I update every time it changes which is like once a day. The app I am building isn't in production yet but in production you should just be able to put whatever the URL is for the app once it is on servers somewhere with a HTTPS URL
I have built a couple different shopify apps when I was trying to learn how to do it, so I have never put one in production. the one I am currently building will be my first live shopify application that I built.
This sounds very helpful! Exactly same question I had, I was wondering if you know anything about this but when I make a fetch request like shown in the video, it routes to a different ip address then ngrok even if I added that in the proxy configuration. Did you ever get that? I am perhaps starting my app wrong.
Hello James, could you provide some insight into the naming of routes and the verification of incoming requests from the proxy. I have followed the same steps, I am able to send a request to the app-proxy but unable to get it through to the backend api. I receive no errors It simply doesnt connect to the backend.
This has been a little while ago since I done this. I looked at the code I had to see the routes I had set up and I had a POST route to /proxy
@jameshagood Thanks for sharing your knowledge with the community, I am still facing the same issue and have posted the details here - https://github.com/Shopify/shopify-api-js/issues/802
Could you please have a look and if possible can you share snippet code which worked for you ?
I managed to get everything working by simply deploying the app to gcp, the proxy requests simply wouldn't go through for a ngrok url, initially they were blocked by ngroks default browser check but even disabling that changed nothing. So the routes were defined correctly only to begin with thus no blockers on that front.
On our Shopify Expert Marketplace, you can find many trusted third party developers and fr...By Arno Nov 27, 2023
You've downloaded the Search & Discovery app from the Shopify App store, and as you're ...By Skye Nov 8, 2023