Skip to content

@xtandard/kit/ui/embed

@xtandard/kit/ui/embed — createEmbed({ App, scopeClass, api, themeKey }) builds a product’s React embed (Dashboard + the token-scoped TokenEmbed) on the shared plumbing: synchronous API base, one theme per embed on the scoped wrapper, portals inside the wrapper, hash / browser / memory routing (the memory router keeps its query string), and query invalidation when the token changes.

Optional peers: react, react-dom, wouter, @tanstack/react-query.

import { … } from "@xtandard/kit/ui/embed";
Name Summary
createEmbed Build a product’s embed components from its App, scope class, API client and theme key.
useEmbedRouting Resolve an EmbedRouting to wouter hooks; memory is created once per mount.
Name Summary
CreateEmbedOptions Options for createEmbed.
Embed What createEmbed returns.
EmbedBaseProps The props every embed component accepts (products add their own, e.g. initialTenant).
ResolvedRouting The wouter hooks for a routing strategy.
TokenEmbedBaseProps Props of the token component: EmbedBaseProps plus the token.
Name Summary
EmbedRouting How an embed routes between views.
EmbedTheme Theme modes for an embed: auto (own toggle), inherit (follow the host), or a fixed theme.