How can i run my embedded Shopify app locally

Viewed 1989

I created an embedded Shopify app and i am trying to run it on localhost.

When i install it on http://www.localhost:3000/login enter image description here it redirects me to the admin panel even though i set my redirect link to http://localhost:3000/auth/shopify/callback

I want to know how i can get it working locally.

2 Answers

you can achieve that without using ngrok-like service with the combination of a proxi and a fake dns record.

  1. add fake domin in the System32\drivers\etc\hosts file like this:

    127.0.0.1 www.<your fake domain>.com

  2. run local proxy service like npm local-ssl-proxy:

    local-ssl-proxy --source 443 --target 3000

  3. whitelist your fake domain in the Shopify app settings. enter image description here

  4. add Env variable in the env file:

    NODE_TLS_REJECT_UNAUTHORIZED=0

the above worked for me with a Shopify AppProvider

Related