Forwarding Shopify accessToken to external service
How can I safely get my Shopify app’s accessToken in Gadget and pass it to an external service (so that service can call the Shopify Admin API on the shop’s behalf)? I tried reading it inside an Action but it’s undefined. What’s the recommended way to access the token in Gadget and forward it (or an alternative pattern like proxying requests)?
1 Reply
Hi Samedo,
the
accessToken
field is encrypted but available. To retreive this you would retreive it via the internal api.
for example await api.internal.shopifyShop.findOne("123")
We do have some information as well in our docs about app proxies as well: https://docs.gadget.dev/guides/plugins/shopify/advanced-topics/extensions#authenticated-requests-with-shopify-app-proxies