A sample app for Shopify's JWT integration with Hotwire Turbo
🔒 Future updates to app template will be published in private repository available only for Github Sponsors. The new version with App Bridge 4, Shopify CLI 3, and the other improvements is already there. Become a sponsor to get an access.
The sample app includes:
app-bridge-1
branchapp-bridge-2
branchIn order to redirect OAuth requests securely to localhost, you'll need to setup a tunnel to redirect from the internet to localhost.
To do that, you can install the cloudflared
CLI tool, and run:
# Note that you can also use a different port
cloudflared tunnel --url http://localhost:3000
You will need to keep this window running to maintain the tunnel during development.
For more advanced tunnel setup check out article Setting up Cloudflare Tunnel for development.
To run this sample locally, you can clone this repository and follow these steps:
yarn shopify app config link
yarn shopify app env pull
It will generate .env
file with Shopify API credentials.
HOST
with your cloudflare tunnel to .env
file:HOST=https://<Your tunnel host>
Set the App URL
to https://<your tunnel host>/
and the Allowed redirection URL(s)
to https://<your tunnel host>/auth/shopify/callback
.
bin/setup
bin/dev
This sample uses simple billing configuration provided by shopify_app
gem. You can configure it in config/initializers/shopify_app.rb
using config.billing
setting.
To run your app in Heroku you need add the Shopify API Key, Shopify API Secret and Host to your config vars. You find the API Key and API Secret in your app setup. The host is your heroku app domain.
This templates config vars are:
SHOPIFY_API_KEY
, SHOPIFY_API_SECRET
, HOST