How to authenticate embedded app backend

Highlighted
Tourist
15 0 1

Hi,

I have an embedded app in react served with a nextjs / koa server. I would like to make request from this embedded app to my django backend.

 

I would like to pass though my app proxy to authenticate every request made on my backend.

 

I can't figure out how to make a request from my react frontend to my app proxy.

 

I tried the following:

 

fetch("/apps/my-app/my-api") 

When I do this I get :

GET https://e080523a.ngrok.io/apps/my-app/my-api 404 (Not Found)

And when I fetch on:

fetch("myshop.shopify.com/apps/my-app/my-api") 

I get a Cors error.

 

 

0 Likes
Highlighted
Shopify Staff
Shopify Staff
1041 140 165

Hey @boolangery,

 

App proxies are for the online store, not embedded apps. Given your embedded app is hosted on a different domain to the store, this explains the CORS issue. 

 

Try skipping proxies all together and send the request directly to your server.

0 Likes