Hi,
We are building a sales channel for one of our merchants. We started off building a public app (which is converted to Sales channel) using the tutorial https://shopify.dev/tutorials/build-a-shopify-app-with-node-and-react.
We have implemented OAuth to connect the app with the store. Since this is a Sales channel, we need access to the storefront API. Hence, to fetch storefront access token using the access token generated from OAuth, in the _app.js we have used getInitialprops to make the admin api call to fetch the storefront access token.
All of these works fine in our local setup - we are able to spin up the sales channel, view the products there. When we try deploying the sales channel app to Amplify, we see ‘AccessDenied’.
Here are our configs -
_app.js -
MyApp.getInitialProps = async ({ ctx }) => {
// Obtain StorefrontAccessToken
return {
storefrontAccessToken: storeToken
}
}
package.json - build - “next build && next export”
amplify.yml
version: 1
frontend:
phases:
preBuild:
commands:
- npm ci
build:
commands:
- npm run build
artifacts:
baseDirectory: out
files:
- '**/*'
cache:
paths:
- node_modules/**/*

