Skip to content

@xtandard/webhooks/react

@xtandard/webhooks/react — embed the dashboard as a React component in your own app (advanced mode). Most users mount the bundled SPA via a framework adapter and never touch React; this is for teams that want the panel inside an existing React shell.

Two components share the same SPA internals:

import { WebhooksDashboard, WebhooksPortal } from "@xtandard/webhooks/react";
import "@xtandard/webhooks/react/styles.css";
// Full admin — point it at wherever the panel API is mounted:
<WebhooksDashboard apiBaseUrl="/webhooks" />
// Customer-scoped portal — pass a portal token minted server-side:
<WebhooksPortal apiBaseUrl="/webhooks" token={portalToken} />

react and react-dom are peer dependencies in this mode. The components are self-contained otherwise (TanStack Query and styles are bundled).

import { … } from "@xtandard/webhooks/react";
Name Summary
WebhooksDashboardProps Props for WebhooksDashboard.
WebhooksPortalProps Props for WebhooksPortal.
Name Summary
EmbedTheme Theme modes for the embedded components (see WebhooksDashboardProps.theme).
Name Summary
getThemePref The stored preference (system when unset, invalid, or storage is unavailable).
setApiBase Point the API client at a base URL (used by the @xtandard/webhooks/react export).
setApiToken Attach a portal token (whpt_…) as a Bearer credential on every request.
setThemePref Persist pref and notify subscribers.
WebhooksDashboard The full webhooks admin dashboard as an embeddable React component.
WebhooksPortal The customer-scoped consumer portal as an embeddable React component. Renders the same shell as WebhooksDashboard with the portal token attached as a Bearer credential; the server scopes every request to the token’s application and the shell renders the reduced portal chrome.
Name Documented on
default (WebhooksDashboard) @xtandard/webhooks/react