@allternit/apps-bridge is for code that runs inside a View. It has no dependencies and no build requirement.
AppsBridge
A small client for the standard MCP Apps bridge, which is JSON-RPC over postMessage to the host.
The bridge only accepts messages from its own parent window, answers
ui/resource-teardown so the host can close the View, and applies only ---prefixed host style variables. Requests that fail reject with a BridgeError carrying the JSON-RPC code.
window.allternit
The optional host extensions. Feature-detect them so the View still runs elsewhere.
window.allternit is @allternit/apps-bridge/allternit-ext.js, a single dependency-free file. view() from apps-server inlines it for you; if you write your own HTML, inline it in a <script> tag (the View CSP allows inline scripts). Methods and confirmation behavior are in the window.allternit reference.
Compatibility shim
Views written for another host’s SDK read a host-specific global.@allternit/apps-bridge/compat.js defines that global on top of the standard bridge so those Views run unchanged, and the package exports the same opt-in rule Allternit hosts use:
ui/initialize, which conflicts with Views that use AppsBridge. Do not load both. See Porting.