Skip to main content

useWebhookEndpoints

The useWebhookEndpoints hook fetches existing webhook endpoints.

Return Value

endpoints
EndpointWithSubscriptions[]
Endpoint list.
loading
boolean
Whether endpoints are loading.
error
unknown
Error from the latest request.
refetch
() => void
Revalidate endpoints.

Example

import { useWebhookEndpoints } from "@wacht/react-router";

function EndpointList() {
  const { endpoints } = useWebhookEndpoints();
  return <pre>{JSON.stringify(endpoints, null, 2)}</pre>;
}