Skip to content

surfaceHost

function surfaceHost(platform, opts): SurfaceHost;

Create a single-slot SurfaceHost over platform.embedSurface. Use it when a host renders one embedded surface and swaps its params as the user’s selection changes.

Pick<Platform, "embedSurface">

SurfaceHostOptions

SurfaceHost

const invoices = surfaceHost(platform, {
providerId: "billing", surfaceName: "invoice-list", mount,
onError: (e) => platform.log("warn", "invoice surface failed", { code: e.code }),
});
invoices.render({ customerEmail }); // embeds, then updates on every later call