create Hydrogen Contextutility
The function creates the context object required to use Hydrogen utilities throughout a Hydrogen project.
Anchor to createhydrogencontext(options)createHydrogenContext(options)
Any cookie implementation. By default Hydrogen ships with cookie session storage, but you can use another session storage implementation.
An instance that implements the Cache API
Cart handler overwrite options. See documentation for createCartHandler for more information.
Customer Account client overwrite options. See documentation for createCustomerAccountClient for more information.
An object containing a country code and language code
Whether it should print GraphQL errors automatically. Defaults to true
Storefront client overwrite options. See documentation for createStorefrontClient for more information.
The function is used to keep the current request/response lifecycle alive even after a response has been sent. It should be provided by your platform.
Anchor to returnsReturns
A collection of utilities used to interact with the cart.
A GraphQL client for querying the Customer Account API. It also provides methods to authenticate and check if the user is logged in.
Any cookie implementation. By default Hydrogen ships with cookie session storage, but you can use another session storage implementation.
A GraphQL client for querying the Storefront API.
The function is used to keep the current request/response lifecycle alive even after a response has been sent. It should be provided by your platform.