What is the best approach for fixing bugs of existing Shopify app?

105 Views Asked by At

I have deployed my Shopify app code on fly.io and I have added App URL and allowed redirection URL's in App setup setting of Shopify partners dashboard with fly.io production server URL's. But, when I am running npm run dev from locally it updates App URL and allowed redirection URL's in App setup of Shopify partners dashboard with ngrok URL's (dev) and this breaks my live app

Can someone please guide me, How to debug code locally without effecting anything on live app ?

Currently I am using two apps one for dev and other for prod but the issue that I am facing with theme code extension is that When I use

npm run dev

it automatically pushes extension code to dev app draft but I am deploying it to prod it is not pushing extension code to prod app

My docker file

FROM node:18-alpine

ARG SHOPIFY_API_KEY
ENV SHOPIFY_API_KEY=XXXXXXXXXX
EXPOSE 8081
WORKDIR /app
COPY web .
RUN npm install
RUN cd frontend && npm install && npm run build
CMD ["npm", "run", "serve"]

How can I push my theme extension code from server to prod app extension draft

1

There are 1 best solutions below

0
On

It is simple. You make another API keypair for your App. The same setup, same everything as your development App. For Fly.io and your production App, the URL never changes, so you set the URL for your App and oAuth flow in the API keypair for Fly.io and then you are set. So when you use a local command like yarn dev or npm dev or whatever, you don't care what URL that script generates if you let Shopify auto-upate the API keypair for development.

So now you have one codebase, two API keypairs, and no trouble with Fly.io.