@prvt/mini-app-sdk
v0.1.3
Published
Browser SDK for prvt room web apps.
Readme
@prvt/mini-app-sdk
Browser SDK for apps opened inside a prvt room. The host keeps the LiveKit
connection and integration credentials; this package communicates with the
host through the typed postMessage bridge.
For a no-build integration, load the stable deployment URL instead:
<script src="https://call.example.com/prvt-mini-app.js"></script>
<script>
const app = Prvt.MiniApp.create({ hostOrigin: "https://call.example.com" });
app.ready().then(() => app.request("queue.add", { trackId: "track_123" }));
</script>The script exposes window.Prvt.MiniApp.create and is generated from the same
source as this package.
import { createPrvtMiniApp } from "@prvt/mini-app-sdk";
const app = createPrvtMiniApp({ hostOrigin: "https://call.example.com" });
const context = await app.ready();
const result = await app.request("queue.add", { trackId: "track_123" });
app.close();The hostOrigin should be the canonical prvt application origin. The context
contains only display context and capabilities; it never contains a room code,
participant token, or integration key. Actions are handled by the integration
that opened the app and should be validated and idempotent on that backend.
For a reusable coding-agent brief, see
AGENT_PROMPT.md. It describes the browser app lifecycle,
the typed action bridge, security boundaries, and the corresponding integration
handler.
