React node js tutorial app cant be access out side of shoplift admin panel

Highlighted
Tourist
8 0 0

im a creating an app by following node js react tutorial,I am able to create js scripts using script tag to display in shop front end,but am not able to access the app  route URL from script tag js script ,I need to access the some of the url of next js app from public(store embed js script to get dynamic data) ,how can I do this?also I need to access store api form script tag java script file based on the store front end customer action.

0 Likes
Highlighted
Tourist
8 0 0

I didnt change anything in project struct er 

0 Likes
Highlighted
Shopify Partner
1866 181 748

Hello @logesh 

If I understood your question correctly, if you're developing your app locally, then you will need to use some sort of HTTP/S tunnel such as Ngrok for your app to be publicly accessible.

As for being able to display dynamic data from your app in your store, unless your app is loaded in the theme as a JS app, you may need to use an application proxy.

 

Hope that helps!

Liked this post? You might also like our fantastic upsell apps Candy Rack and Candy Cart or offer free gifts with Gift Box. All made with ❤️  and care by Digismoothie
Highlighted
Tourist
8 0 0

I am using ngrok for tunneling with my local host,I have loaded my app js file to online store using script tag and I want to access my app directly from the js file to get data from my app to display in online store front ,if I use post man to hit the api url to get the data below response ,if i send the shop name with the url it redirects to admin login.

Expected a valid shop query parameter

 

0 Likes
Highlighted
Shopify Partner
1866 181 748

Not sure I follow entirely, but is your app script trying to hit an Admin API, if so that won't work from the storefront without you having your own API to make these Admin API requests.

i.e. say you wanted your app to edit orders from within the storefront. Your storefront scripts cannot call orderEditBegin mutation because that's a GraphQL Admin API but your apps backend can thus your app script calls your API, your API calls Shopify Admin API.

Liked this post? You might also like our fantastic upsell apps Candy Rack and Candy Cart or offer free gifts with Gift Box. All made with ❤️  and care by Digismoothie
Highlighted
Tourist
8 0 0

yes .correct in the nodejs react app(Shopify toturial) also I am not access the /api  route directly from the storefront java script because all the request are went to shopify auth middleware in Koa route so I cant access any url out side of the store  Admin app panel.

0 Likes
Highlighted
Shopify Partner
667 47 134

Off-topic, but I will have to remember the Shoplift moniker.

For those times when we are reviewing expenses for Shopify Plus, payment processing fees, and transactional fees. I might have to borrow this nickname for when I meet with our CFO.

0 Likes