API
The public XTend APIs for loaders, components and host integration.
What it covers
api.js initializes XTend browser feedback and theme APIs. The public entry point is initXTendAPI(manifest); after successful setup, xtend-api-ready reports which sub-APIs are available.
Public building blocks
api.jscontains runtime code and writes towindow.XTend.api.d.tstypes theme, toast, alert, dialog, and modal APIs.components/xtend-state.jsstores shared Classic UI state.
Recommended workflow
Import the API explicitly and wait for its ready event:
import { initXTendAPI } from "/api.js";
window.addEventListener("xtend-api-ready", ({ detail }) => {
if (detail.toast) window.XTend.toast.success("Ready");
}, { once: true });
await initXTendAPI({ "x-toast": "./components/xtoast.js" });
A missing module rejects initialization. Inspect the manifest and browser console instead of treating an uninitialized namespace as a successful API.