Questions and discussions about using the Shopify CLI and Shopify-built libraries.
While developing Shopify Embedded app locally, session token is not resolved.
I'm using ngrok as per guides in Shopify.
My app initialize:
const [appBridgeConfig] = useState(() => {
const host = btoa('xxx.eu.ngrok.io/')
window.__SHOPIFY_DEV_HOST = host;
return {
host,
apiKey: process.env.CLIENT_ID,
forceRedirect: false,
};
});
Same host is in Partners Dashboard. Using `authenticatedFetch` function:
export function useAuthenticatedFetch() {
const app = useAppBridge();
const fetchFunction = authenticatedFetch(app);
return async (uri, options) => {
const response = await fetchFunction(uri, options);
console.log('Waiting');
checkHeadersForReauthorization(response.headers, app);
return response;
};
}
And nothing is printed in console after `fetchFunction` . While using Demo store for app testing - it works like a charm. Packages:
"@shopify/app-bridge": "^3.7.2",
"@shopify/app-bridge-react": "^3.7.2",
"@shopify/app-bridge-utils": "^3.5.1",
Hi @ssmellow 👋 Issues with App Bridge can be submitted directly in the repo here.
Developer Support @ Shopify
- Was this reply helpful? Click Like to let us know!
- Was your question answered? Mark it as an Accepted Solution
- To learn more visit Shopify.dev or the Shopify Web Design and Development Blog
Already did that, want to get help everywhere, because stuck for a week with it.