Skip to main content
function useX402(options: FetchWithX402Options): FetchWithX402ReturnType;
Hook that provides a fetch function with X402 payment handling.

Parameters

ParameterTypeDescription
optionsFetchWithX402OptionsConfiguration object for the fetch function

Returns

FetchWithX402ReturnType A fetch function with X402 payment handling

Example

const { fetchWithPayment } = useX402();
const response = await fetchWithPayment("https://x402-resource.com", {
  method: "GET",
});