I want to make a public app (loyalty program app), a merchant installs the app , will it integrate in his store? , so lets say a customer logs in then what will be the flow , how to get storefront api access token. Please explain in simple words.
Hey @Ammaar_Farhan_Syed, we have a complete tutorial that shows exactly how to do this.
Start by using Shopify CLI to scaffold your app.
This starter template handles all the merchant authentication automatically using modern best practices (session tokens + token exchange). When a merchant installs your public app, it integrates into their store, and the template takes care of the entire OAuth flow for you.
For the customer side of your loyalty app, the key insight is: customers authenticate with Shopify, not with your app. You build Customer Account UI Extensions that render inside the customer account pages where customers are already logged in. This means you don’t need to worry about customer authentication flows.
We have a complete working example of a loyalty app that shows exactly what you’re trying to build: Build a Loyalty App Tutorial. It demonstrates how to display loyalty points on customer Profile and Order Status pages.