Skip to content

@xtandard/entitlements/react/embed

@xtandard/entitlements/react/embed — the admin dashboard and the customer portal as React components, for hosts that want them inside their own React tree instead of the bundled SPA the adapters serve.

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

react and react-dom are peers; everything else (TanStack Query, Base UI, styles) is bundled. The stylesheet is scoped under .xtandard-entitlements, so it cannot leak into the host. For gating your own UI (<Gate>, useEntitlement, <UsageMeter>), use the much smaller @xtandard/entitlements/react instead.

import { … } from "@xtandard/entitlements/react/embed";
Name Summary
CustomerPortalProps Props for CustomerPortal.
EntitlementsDashboardProps Props for EntitlementsDashboard.
Name Summary
EmbedTheme Theme modes for the embedded components (see EntitlementsDashboardProps.theme).
Name Summary
CustomerPortal The customer portal (plan, usage vs. limits, plan comparison with checkout, “Manage billing”) as a React component, scoped by a portal token.
EntitlementsDashboard The full admin dashboard (Overview, Catalog, Customers, Activity) as a React component.
getThemePref The stored preference (system when unset, invalid, or storage is unavailable).
setApiBase Point the API client at a base URL (used by @xtandard/entitlements/react/embed).
setApiToken Attach a portal token (entpt_…) as a Bearer credential on every request.
setThemePref Persist pref and notify subscribers.
Name Documented on
default (EntitlementsDashboard) @xtandard/entitlements/react/embed