CroctContext
Learn about the Hydrogen load context exposed to your loaders and actions.
This type describes the Hydrogen load context, the context argument every loader, action, and the server.ts fetch handler receive. It works the same on both the React Router 7 and Remix setups.
The SDK reads the Oxygen environment from env and the per-request visitor context from croct.
Definition
The type has the following shape:
type CroctContext = { env: unknown, croct?: RequestContext,};Properties
The following list describes the properties:
- envunknown
The Oxygen environment bindings for the current request.
- croct(optional)RequestContext
The per-request visitor context resolved by the SDK.
It is set by the middleware on React Router 7, or by the context helper on Remix, and is absent until one of them runs.