useShopwareContext ​
Category:
Context & Language
Types ​
ts
export function useShopwareContext(): ShopwareContextts
export type ShopwareContext = {
devStorefrontUrl: string | null;
/**
* Shopware API client
*/
apiClient: ApiClient;
/**
* Browser locale, working in SSR
* If not provided, it will be "en-US"
*/
browserLocale: string;
/**
* When `true`, reads may use the cacheable GET variants of the Store API.
* `useCacheableRead().invokeRead` decides per request.
*
* @deprecated Do not branch on this flag. For a registered read, use
* `useCacheableRead().invokeRead`. It also checks the session. Keep other
* reads on POST. A branch on this flag sends GET with the context token,
* also for a logged-in customer.
* @default false
*/
cacheableReads: boolean;
/**
* `true` when the server render runs without the visitor's session.
*
* @default false
*/
ssrWithoutUserContext?: boolean;
};