Multipage apps

Solved

Multipage apps

tunisoft25
Shopify Partner
2 0 0

Hi

 

I'm developing an app that has several pages. Should I include the query parameters such as (host,shop,hmac) in every link? Is there a better way to do it?

 

Thank you

Accepted Solution (1)

Promer-Alena
Shopify Partner
250 26 67

This is an accepted solution.

Hi @tunisoft25 

 

Yes, you should include the host and shop parameters in every link to maintain authentication and ensure a smooth user experience. Shopify uses these parameters to verify the session and keep the app embedded within the admin panel.

 

But a better approach is to use Session Tokens instead of relying on URL parameters. Shopify recommends using session tokens for authentication because they provide better security and prevent issues with expired or invalid query parameters. You can retrieve the session token on each page load and authenticate it with Shopify's App Bridge and JWT authentication.

 

If your app is embedded, use Shopify App Bridge's authenticatedFetch() to securely process API calls without manually passing parameters

View solution in original post

Replies 3 (3)

Promer-Alena
Shopify Partner
250 26 67

This is an accepted solution.

Hi @tunisoft25 

 

Yes, you should include the host and shop parameters in every link to maintain authentication and ensure a smooth user experience. Shopify uses these parameters to verify the session and keep the app embedded within the admin panel.

 

But a better approach is to use Session Tokens instead of relying on URL parameters. Shopify recommends using session tokens for authentication because they provide better security and prevent issues with expired or invalid query parameters. You can retrieve the session token on each page load and authenticate it with Shopify's App Bridge and JWT authentication.

 

If your app is embedded, use Shopify App Bridge's authenticatedFetch() to securely process API calls without manually passing parameters

tunisoft25
Shopify Partner
2 0 0

Thank you

 

I used the token with POST requests and it worked fine. I got the token through the app bridge.

 

Can I pass the token as a query parameter in the URL or does it only work as an authentication header?

 

Thank you

Arif_Shopidevs
Shopify Partner
488 40 91

You can got those information shop shop information. In URL that is not necessary  other thank hmac , if you have no special need in url.

Syncora: Backup & Restore [Free] - Automated real-time store backup with one-click easy restore.
Slider Revolution - Create sliders, theme sections, banners, videos, pages, advanced animation, and social feeds.
Essential Grid Gallery - Create photo galleries, video galleries, portfolio galleries, product gallery, collection gallery, and more.
EasyDisplay: Product Showcase - Easily display collections, related products, discounts, recently viewed items, and best sellers.