Supported actions
The bridge supports notifications, closing and the shared Save/Discard bar for unsaved changes. Use message version 1 and the exact Fysicl host origin. The host accepts messages only from the active app frame at its saved origin.
The shared bar is opt-in: configure real save and discard handlers with configureHostSaveActions, then reportUnsavedChanges(true). Without this configuration the CLI scaffold sends saveable: false and the app manages saving itself. A visual or code editor can keep its own Save button. The loaded capability controls only the loading screen and does not enable the save bar.
const hostOrigin = 'https://admin.fysicl.dev'
// Match the exact dashboard origin used for this installation.
window.parent.postMessage({
type: 'fysicl:toast', version: 1,
tone: 'success', message: 'Saved'
}, hostOrigin)
window.parent.postMessage({
type: 'fysicl:dirty', version: 1, dirty: true, saveable: true
}, hostOrigin)
// Set saveable only after registering real Save/Discard handlers.
// Validate event.source, event.origin and version before handling host messages.
// On fysicl:save or fysicl:discard, perform the operation, then reply:
// { type: 'fysicl:action-result', version: 1, requestId, success }
// Send dirty: false only after saving or restoring the persisted draft.
window.parent.postMessage({
type: 'fysicl:close', version: 1
}, hostOrigin)Limits
Notifications contain plain text of at most 160 characters, with at most three messages per ten seconds. The host chooses the return route. Only when both dirty and saveable are true does the search bar become the shared Save/Discard bar. Dashboard navigation stays blocked until changes are saved or discarded. Declare saveable: true only when your app handles fysicl:save and fysicl:discard. Acknowledge the requestId with fysicl:action-result and success: true only after success; preserve the draft on failure. Guard navigation within your own iframe. Call bridge.navigationBlocked() when rejecting an internal move so the host bar briefly pulses red and shakes. Closing the browser tab retains the browser warning. The launch message includes the dashboard locale; fysicl:locale delivers later language changes.