Skip to content
Shopware

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`, composables read data through the cacheable GET variants of
   * the Store API (criteria compressed into the `_criteria` query param)
   * instead of POST. This unlocks HTTP/CDN caching and drops the CORS
   * preflight, but requires a backend that supports the GET read routes.
   *
   * @default false
   */
  cacheableReads: boolean;
};

source code