Handling navigation & request verification inside of an app

Solved
Highlighted
Shopify Partner
2 0 0

Hi,

 

I'm new to Shopify app development and I'm developing a public app using Node/Express JS.

 

The app contains several pages (and navigation links to access those pages) as shown in the screenshot below:

1.PNG

When I first click on the app from the admin, the query parameter comes with hmac to validate the request.

 

But when I start clicking on links from inside the app, (on Products and Home), the query parameter is empty so I'm unable to verify the request using hmac.

 

My question is:

 

  1. Am I doing something wrong here?
  2. How do you handle navigation links from inside of an app?
  3. What is the best approach if I continue using Node/Express instead of native Shopify tools (App Bridge etc.)?

Thanks in advance!

0 Likes
Highlighted
Shopify Staff
Shopify Staff
77 24 10

This is an accepted solution.

Hi @BilalShahid10 

 

In your use case, you need to carry request query params manually when navigating to new urls. As you may notice, your app is loaded inside an iframe. If a redirect happens inside iframe, Shopify doesn't have control to generate new hmac and timestamp. App Bridge does it for you via App Redirect action https://help.shopify.com/en/api/embedded-apps/app-bridge/actions/navigation/redirect#redirect-to-a-r...

 

Thanks, 

Henry

0 Likes
Highlighted
Shopify Partner
2 0 0

Thanks @Henry_Tao !

 

That's what I was thinking - to pass query params manually.

0 Likes