useShop
The useShop
hook provides access to values within the shopify
property in the hydrogen.config.js
file. It must be a descendent of a ShopifyProvider
component.
Example code
Anchor link to section titled "Example code"
Return value
Anchor link to section titled "Return value"The useShop
hook returns an object with the following keys:
Key | Description |
---|---|
defaultCountryCode |
The defaultCountryCode from hydrogenConfig.shopify . |
defaultLanguageCode |
The defaultLanguageCode from hydrogenConfig.shopify . |
storeDomain |
The store domain set in hydrogenConfig.shopify . |
storefrontToken |
The Storefront API token set in hydrogenConfig.shopify . |
storefrontApiVersion |
The Storefront API version set in hydrogenConfig.shopify . |