It seems currently fairly challenging to get details about our app from the Customer Account extension. In our case we have our API we need to access but this URL changes from environment to environment.
Option #1: Add more properties from useExtension
. Perhaps an app
object? This could include:
- appId
- appUrl
- name
- clientId
All these details are specified within the extension TOML but there’s no access to reading those properties (only merchant-facing settings).
Option #2: Add an app
query to the API.
We can do this in Liquid and it works great, but now we’re stuck having to save a metafield like shop.metafields.my_app.config
that we can read from. The trouble with this approach is we have dev/staging/prod apps that all reach into this namespace/key, which creates conflict issues. We could append our app ID to this namespace, but then again how does that get passed to the extension?
Bonus: allow us to add “environment” variables of some sort to the extension TOML that could be read out from useExtension
(or other).