App reviews, troubleshooting, and recommendations
when i try to call get function from server.js and console the response using fetch('/getproducts') function i see the error in console
Response {type: 'basic', url: 'https://630a-182-176-104-93.ngrok.io/auth?shop=undefined', redirected: true, status: 200, ok: true, …}
how to solve shop=undefined
this is my function
router.get('/getProducts', verifyRequest(), async(ctx,res) => {
const { shop, accessToken } = ctx.session;
const url = `https://${shop}/admin/api/2022-01/products.json`;
const shopifyHeader = (token)=>({
"Content-Type": "application/json",
"X-Shopify-Access-Token":token,
});
const getProducts = await axios.get(url,{headers:shopifyHeader(accessToken)});
ctx.body = getProducts.data;
ctx.res.statusCode = 200;
});
Shopify and our financial partners regularly review and update verification requiremen...
By Jacqui Mar 14, 2025Unlock the potential of marketing on your business growth with Shopify Academy's late...
By Shopify Mar 12, 2025Learn how to increase conversion rates in every stage of the customer journey by enroll...
By Shopify Mar 5, 2025