Im trying to send a http request from my embeded app extention that im building to the app backend, is there a way to do it?
I added the http request to the liquid code but i get authorization errors - example - Missing Authorization header, was the request made with
authenticatedFetch? | {isOnline: false}
what is the best way to send http requests from outside to the app server?
Yes, you can send HTTP requests from your embedded app extension your app’s backend server. However, due to security measures, you need to authenticate these requests.
The issue you’re facing likely arises from not attaching a valid session token to your requests.
In your extension, use the session token API to fetch a new session token. Session tokens expire every minute, so always fetch a new token before making a request to your app’s backend server.
After your extension has received a session token, you can include it in requests to your server. You should include the session token in the request header.
In the example link that you sent they show how to create a session token with the app-bridge. but i need to get it from the “frontend” of the app extention, i send the http request from the liquid code of the app to the server, then how can i generate the token from the liquid code?