/shopify-hotwire-sample

A sample app for Shopify's JWT integration with Hotwire Turbo

Primary LanguageRuby

Shopify Hotwire Sample

The sample app includes:

Since the shopify_app gem is not fully compatible with App Bridge 2 this sample uses fork.

Shopify Hotwire Sample

The old App Bridge 1 sample can be found in app-bridge-1 branch.

Quick start

To run this app locally, you can clone this repository and do the following.

  1. Connect to Shopify:
shopify rails connect
  1. Setup Rails app:
bin/setup
  1. Run ngrok on port 3000:
ngrok http 3000
  1. Start the app:
rails s
  1. Install and open this app on a development shop.

Optional

  1. Add an ngrok configuration

~/.ngrok2/ngrok.yml

authtoken: $$$$$$$$$$$
region: eu

tunnels:
  hotwire-example:
    addr: 3000
    proto: http
    bind_tls: true
    subdomain: hotwire-example
  hotwire-webpack:
    addr: 3035
    proto: http
    bind_tls: true
    subdomain: hotwire-webpack
    host-header: localhost:3035
  1. Add NGROK_WEBPACK_TUNNEL to your .env file
SHOPIFY_API_KEY=foo
SHOPIFY_API_SECRET=bar

// This is needed so you don't get CORS issues when Webpack pings while inside the Shopify admin
NGROK_WEBPACK_TUNNEL=hotwire-webpack.eu.ngrok.io
  1. Use foreman to run the Rails server & Webpack at the same time
foreman start -f Procfile.dev

image