npm package discovery and stats viewer.

Discover Tips

  • General search

    [free text search, go nuts!]

  • Package details

    pkg:[package-name]

  • User packages

    @[username]

Sponsor

Optimize Toolset

I’ve always been into building performant and accessible sites, but lately I’ve been taking it extremely seriously. So much so that I’ve been building a tool to help me optimize and monitor the sites that I build to make sure that I’m making an attempt to offer the best experience to those who visit them. If you’re into performant, accessible and SEO friendly sites, you might like it too! You can check it out at Optimize Toolset.

About

Hi, 👋, I’m Ryan Hefner  and I built this site for me, and you! The goal of this site was to provide an easy way for me to check the stats on my npm packages, both for prioritizing issues and updates, and to give me a little kick in the pants to keep up on stuff.

As I was building it, I realized that I was actually using the tool to build the tool, and figured I might as well put this out there and hopefully others will find it to be a fast and useful way to search and browse npm packages as I have.

If you’re interested in other things I’m working on, follow me on Twitter or check out the open source projects I’ve been publishing on GitHub.

I am also working on a Twitter bot for this site to tweet the most popular, newest, random packages from npm. Please follow that account now and it will start sending out packages soon–ish.

Open Software & Tools

This site wouldn’t be possible without the immense generosity and tireless efforts from the people who make contributions to the world and share their work via open source initiatives. Thank you 🙏

© 2026 – Pkg Stats / Ryan Hefner

@openseat/cloud

v0.1.0

Published

Browser client for the OpenSeat Cloud API: live seat maps, hold tokens and browser holds with your publishable key, plus OpenSeatBookingMap for React (hold or select mode, seats and standing zones).

Readme

@openseat/cloud

The OpenSeat Cloud API in the browser. Show a live seat map for your event with your publishable key, let the buyer choose seats and standing-zone tickets, and hold them; your server then books them with @openseat/node after payment.

  • Publishable key only. os_pk_live_… / os_pk_test_… works only from the origins you allowed. A secret key (os_sk_…) is refused before anything is sent.
  • Seats and zones. Numbered seats, whole tables, booths and standing or seated zones sold by quantity, in the same event or zones only.
  • Two ways to hold. hold mode: the page holds with a hold token and gives you the token. select mode: the page only lets the buyer choose, and your server holds (server holds, keyed by your own buyer ID).
npm install @openseat/cloud
# for the React component:
npm install @openseat/react react react-dom konva

react, react-dom, konva and @openseat/react are optional peers: they are needed only for @openseat/cloud/react. The root entry has no React code.

React: hold mode

import { OpenSeatBookingMap } from "@openseat/cloud/react";

<OpenSeatBookingMap
  publicKey={pk}
  baseUrl={url}
  eventKey="tedx-2026"
  onHeld={async (h) => {
    const o = await createOrder(h.holdToken);
    openRazorpay(o);
  }}
/>;

The buyer chooses seats (and zone quantities in a ticket picker, a bottom sheet on phones), then taps Continue with N tickets. The page holds them and calls onHeld once per hold, with an OpenSeatHold:

interface OpenSeatHold {
  holdToken: string; // send it to your server in a request body, never in a URL
  holdId: string;
  eventKey: string;
  seatIds: readonly string[];
  areas: readonly { inventoryId: string; quantity: number }[]; // zones, booths and whole tables
  expiresAt: string;
  locked: boolean; // true once your server attached an order
}

Your server attaches the order (openseat.holds.attachOrder(holdToken, orderId), which locks the hold), takes payment, and books it (openseat.events.book({ eventKey, holdToken, orderId })). The page sees the lock within holdRefreshMs (default 15 s) and the booking through the live feed, and shows Booked.

While held, the page shows an m:ss countdown and Change seats (disabled once locked): the buyer picks other seats on the map and taps it to swap the hold atomically (their old seats never become free in between). An expired hold keeps the choice selected so one tap holds it again.

Props (besides BookingMap's display props such as theme, legend, mapHeight, rules):

| Prop | | | ---------------------------------------------------------------------------------- | ---------------------------------------------------------------------------------------- | | eventKey | Your event key (the ID you created the event with). | | publicKey + baseUrl, or client | Credentials, or a client from createOpenSeatClient. | | mode | "hold" (default) or "select". | | onHeld(hold) | Hold mode: seats held. A returned promise is awaited, then the hold is re-read. | | onHoldChange(hold \| null), onHoldExpired(), onCompleted(hold), onError(e) | Lifecycle. | | resume | "session" (default): a reload in the same tab resumes the hold. false turns it off. | | holdRefreshMs | How often the hold is re-read while held. Default 15,000. | | maxTickets | Per-buyer limit; beats the event's maxTicketsPerBooking (as does rules.maxTickets). | | categoryPrices | Display prices by category; beats the event's price labels ("1499" shows as ₹1,499). | | renderActions(flow) | Replace the default buttons, with the whole useBookingFlow result. | | renderCheckout(ctx) | Shown under the countdown while held: { hold, remainingMs, locked, extend, release }. | | loadingFallback, errorFallback(e) | Shown while loading, or when the event cannot be loaded. | | onAreaSelect | Replaces the built-in zone picker (then set quantities through renderActions). |

React: select mode (your server holds)

For platforms that hold from their own server (openseat.holds.create({ eventKey, buyerRef, seatIds, areas }) in @openseat/node), so a buyer's ticket limit follows your own user ID:

<OpenSeatBookingMap
  publicKey={pk}
  baseUrl={url}
  eventKey="tedx-2026"
  mode="select"
  ownHold={
    serverHold && {
      holdId: serverHold.holdId,
      seatIds: serverHold.seats.map((s) => s.seatId),
      areas: serverHold.areas.map((a) => ({ inventoryId: a.inventoryId, quantity: a.quantity })),
      expiresAt: serverHold.expiresAt,
    }
  }
  onContinue={async ({ seatIds, areas }) => {
    const hold = await api.holdSeats({ eventKey: "tedx-2026", seatIds, areas }); // your backend
    if (hold.ok) goToCheckout(hold);
  }}
/>
  • Select mode never mints a hold token or sends a hold request from the page.
  • onContinue receives { seatIds, areas } in the shape holds.create takes: whole tables come as an area ({ inventoryId: tableId, quantity: 1 }). A returned promise keeps the button busy.
  • ownHold is the hold your server already made for this buyer (for example when they come back to change seats): its seats and places are shown as theirs and chosen on the map, the live feed's "held" for them is ignored, and a "Held for you" countdown runs to its expiresAt. Pass the new one after your server replaces it.

Without React

import { createOpenSeatClient, rememberHold, recallHold } from "@openseat/cloud";

const openseat = createOpenSeatClient({ publicKey: pk, baseUrl: "https://openseat.example.com" });

const event = await openseat.loadEvent("tedx-2026"); // { name, layout, priceLabels, saleOpen, etag, … }
const stop = openseat.watchEvent("tedx-2026", (e) => redraw(e.layout)); // only when the layout revision changes

const a = openseat.adapter; // a BookingAdapter for @openseat/booking and @openseat/react
await a.prepare("tedx-2026"); // mint the hold token early (on the buyer's first click)
const hold = await a.holdSeats({ eventId: "tedx-2026", seatIds: ["A-1"], idempotencyKey: crypto.randomUUID() });
const token = a.holdToken("tedx-2026");

| Method | | | ------------------------------------------------ | --------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------- | | loadEvent(eventKey, { ifNoneMatch?, signal? }) | The event and its layout, or "not-modified" for a matching ETag. | | watchEvent(eventKey, onChange) | Re-reads the event (with its ETag) when the live stream resets or reconnects; calls back only for a new layout revision. Returns a stop function. | | adapter | Statuses (getStatuses, getAreaStatuses), live updates (subscribe, subscribeAreas), holdSeats (atomically replaces the token's hold), getHold, extendHold, releaseHold, prepare, holdToken, resetHoldToken. confirmHold is refused: book from your server. | | resumeHold(hold) | After a reload: re-seed the token from recallHold(eventKey) and read the hold. | | completeHold(eventKey) | Your server booked it: drop the token and the remembered hold. | | me() | { mode, allowedOrigins, originAccepted, last4 }: "is my key working here?" |

rememberHold(hold) / recallHold(eventKey) keep one hold per event in sessionStorage (rememberHold(null) forgets them all).

Where the hold token goes

  • Only in the OpenSeat-Hold-Token header of the four hold requests (hold, read, extend, release). Never in a URL, never on reads or the live stream, never in localStorage, never in a log or an error message.
  • In memory, one per event. With resume: "session" also in this tab's sessionStorage, cleared on completion or expiry. A script on the page could read it there, but such a script can already read memory; and once your server attaches the order, the token can no longer change or release the hold.
  • The live stream URL carries the publishable key (?key=), because EventSource cannot send headers. It is not a secret.

Errors and developer messages

Every failure is a BookingError (code, reason, status, retryAfterMs, unavailableSeatIds, unavailableAreaIds); reason is one of OpenSeatErrorReason (the same union as the server and @openseat/node). A wrong key, an origin you have not allowed, and an SDK too old for the event's seat map each print one console.error explaining the fix, naming the key only by its last four characters. An event that cannot be found lists the checks: the event key, API access on, published, and the key's mode.

Reserved

@openseat/cloud/designer (the embeddable layout designer, mountDesigner and <OpenSeatDesigner>) is reserved for the next release and not exported yet.