useHaapiFetch#

Low-level access to the attested HAAPI transport, for driving a flow without HaapiStepper.

Wraps the HAAPI web driver’s fetch in a sendHaapiFetchRequest(action) function that submits a HAAPI action and returns the raw response. Most applications never need this — HaapiStepper (and useHaapiStepper) manage the flow for you; reach for this hook only to build your own flow handling on top of the same attested transport.

const { sendHaapiFetchRequest } = useHaapiFetch(haapiConfiguration);
const response = await sendHaapiFetchRequest(action);

The underlying driver supports a single configuration per page load: every caller shares one driver instance, and passing a different HaapiConfiguration later throws — reload the page to switch.

Was this helpful?