Skip to content

useShopwareContext

useShopwareContext ​

Types ​

ts
export function useShopwareContext(): ShopwareContext

source code

ts
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;
};

source code

Was this page helpful?
UnsatisfiedSatisfied
Be the first to vote!
0.0 / 5  (0 votes)