OpenSeatBookingMap, the buyer's seat page for a Cloud API event, useOpenSeatEvent, and OpenSeatDesigner, the embeddable layout designer. Needs the optional peers react, react-dom, konva and @openseat/react.
2 components
1 hook
3 functions
3 interfaces
3 types
MIT
The React entry point of @openseat/cloud. It needs the optional peers @openseat/react, konva, react and react-dom; the root entry has no React code.
import { OpenSeatBookingMap, OpenSeatDesigner, useOpenSeatEvent,} from "@openseat/cloud/react";import type { OpenSeatBookingMapProps,} from "@openseat/cloud/react";
Components2
component
OpenSeatBookingMap
The whole buyer seat page for one Cloud API event: the live map, seats and standing zones, the basket and the buttons. In hold mode the buyer's choice is held with a hold token (onHeld); in select mode it is handed to you (onContinue) for your server to hold.
The embeddable OpenSeat layout designer for one designer session, as a React component around mountDesigner (@openseat/cloud/designer). Pass the session's embedUrl from your server.
A new embedUrl or height mounts a fresh designer (unsaved changes in the old one are lost); new callbacks and getToken are picked up without remounting, and a new theme is sent to the running designer.
Loads an event (C1) and keeps it current: when OpenSeat signals a resync (the organiser moved the event to a new layout, or the live stream came back), the event is re-read with its ETag and replaced only when its layout revision changed. event is null while loading; error is the reason it could not be loaded.
The session's embedUrl exactly as minted (https://<EMBED_ORIGIN>/embed/designer/dsn_…#os_ds_…).
getTokenoptional
() => Promise<string> | string
Called about two minutes before the session expires. Mint a new session on your server for the same layout and origin and resolve with its token; the designer switches to it without losing work. Without it the designer shows "This session has ended" when the session expires.
heightoptional
number | "auto"
Pixels (200 to 10,000), or "auto" to follow the designer's own height. Default 640.
Re-exported from @openseat/cloud/designer: Something went wrong. code is the designer's (for example DESIGNER_SESSION_EXPIRED), or TOKEN_REFRESH_FAILED when getToken rejected or did not return an os_ds_ token.