Liquid, JavaScript, themes, sales channels
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/**/*
Portrait of Stephen positioned next to an image of planet Earth, with the Stephen's World ...
By JasonH Mar 18, 2024Digital marketers and app developers have tracked activity in apps and websites for yea...
By Ollie Mar 13, 2024February was an exciting month with Shopify Editions, informative webinars, and more! F...
By JasonH Mar 7, 2024