1.3 KiB
1.3 KiB
The useShop
hook provides access to values within shopify.config.js
.The useShop
hook provides access to values within shopify.config.js
. It must be a descendent of a ShopifyProvider
component.
Example code
import {useShop} from '@shopify/hydrogen';
export default function MyPage() {
const {locale} = useShop();
return <h1>The locale is {locale}</h1>;
}
Return value
The useShop
hook returns an object with the following keys:
Key | Description |
---|---|
locale |
The locale set in shopify.config.js . |
storeDomain |
The store domain set in shopify.config.js . |
storefrontToken |
The Storefront API token set in shopify.config.js . |
graphqlApiVersion |
The GraphQL API version set in shopify.config.js . |