Client library for apps embedded by Poster manage platform in an iframe. Provides a small, framework-agnostic surface for talking to the host page.
yarn add @joinposter/manage-platform
# or
npm install @joinposter/manage-platformimport { hideSpinner } from "@joinposter/manage-platform";
hideSpinner();| Action | Purpose |
|---|---|
hideSpinner() |
Tell the host page to hide its loading spinner over the iframe |
More actions (openUrl, setTitle, setUrl) will be added as we migrate callers.
The library is built with Vite library mode. Run a watch build, then link it into a consumer app:
cd poster-manage-platform
yarn install
yarn dev # rebuilds dist/ on every change
yarn link
cd ../<consumer-app>
yarn link @joinposter/manage-platform
yarn devWhen you're done:
cd <consumer-app>
yarn unlink @joinposter/manage-platform
yarn install --force
cd ../poster-manage-platform
yarn unlink# bump version in package.json
yarn build # also runs automatically via `prepublishOnly`
npm publishThe package is scoped under @joinposter; publishConfig.access = "public" keeps it publicly installable.
src/
index.js # public entry, named exports per action
host/
postToHost.js # single chokepoint over window.top.postMessage
actions/
hideSpinner.js # builds the { hideSpinner: true } payload
Every public action is a stateless postMessage to window.top. host/postToHost.js is the only place that touches the browser API, which keeps target-origin policy, sender identity, and any future handshake in one spot.