@seatschart/embed
v0.1.1
Published
SeatsChart embed protocol, viewer URLs, and server-side seat confirm/release helpers
Maintainers
Readme
@seatschart/embed
Vanilla JS helpers for SeatsChart B2B2C iframe checkout integration.
Install
npm install @seatschart/embedViewer iframe URL
import { buildViewerEmbedUrl } from "@seatschart/embed";
const src = buildViewerEmbedUrl({
webBase: "https://your-tenant.seatschart.com",
eventId: "00000000-0000-0000-0000-000000000000",
parentOrigin: "https://checkout.yourplatform.com",
channel: "web",
token: signedJwtFromYourBackend,
transparent: true, // optional — ignores backgroundColor
backgroundColor: "#0f172a", // optional — 6-digit hex when not transparent
});Listen for holds (parent page)
import { createSeatHoldListener } from "@seatschart/embed";
const unsubscribe = createSeatHoldListener({
parentOrigin: "https://checkout.yourplatform.com",
onHeld(payload) {
// Route buyer to your PSP; store holdToken + userId for confirm
},
});Confirm after payment (server only)
import { confirmSeats } from "@seatschart/embed";
await confirmSeats({
apiBase: "https://api.yourplatform.com",
apiKey: process.env.SEATSCHART_API_KEY!,
idempotencyKey: crypto.randomUUID(),
body: {
eventId,
seatIds,
userId,
holdToken,
channel: "web",
},
});See the dashboard Developer documentation for the full checkout handoff flow.
