To find out whose store this configuration belongs to, we query by the merchants shopOrigin. Seems like a sensible way to identify merchants in our database.
The issue is we also need to inject a script tag (using Shopify's script_tag API) into the merchant customer's storefront. The client (site visitor) needs to retrieve this configuration from our database. We resolve this by having a separate API endpoint and supporting `jsonp`. The problem is: how do we identify the merchant's store from the website script. I see two ways to solve this:
2. Provide a way in our embedded app for the merchant to enter in his official domain name. Then on the client script, we can just request the resource, and our server will extract the domain name from the request connections object (we're using Node). Then we use the domain name to query the configuration details instead of the shopOrigin.
Are there any other ways to do this more gracefully? Exchanging data between Shopify App and Shopify Storefront feels like a bit of a hack in general. There has to an easier, officially support method, right?