@seatlayer/js 0.67.14 → 0.67.15

This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
package/README.md CHANGED
@@ -1,20 +1,46 @@
1
- # @seatlayer/js
1
+ # SeatLayer JavaScript Seat Map SDK for Reserved Seating
2
2
 
3
3
  [![npm](https://img.shields.io/npm/v/@seatlayer/js)](https://www.npmjs.com/package/@seatlayer/js)
4
4
  [![npm downloads](https://img.shields.io/npm/dm/@seatlayer/js)](https://www.npmjs.com/package/@seatlayer/js)
5
-
6
- The framework-agnostic SeatLayer embed SDK. Render the complete buyer picker or
7
- a headless interactive chart, let buyers select and **hold** inventory in the
8
- browser, then **book** it from your trusted server.
9
-
10
- [Package on npm](https://www.npmjs.com/package/@seatlayer/js) ·
11
- [Install guide](https://docs.seatlayer.io/buyer-sdk/install/) ·
12
- [Live demo](https://app.seatlayer.io/demo/play) ·
13
- [Website](https://seatlayer.io/developers/) ·
14
- [AI Toolkit](https://github.com/seatlayer/seatlayer-ai-toolkit)
15
-
16
- Works in plain HTML and any framework (React, Vue, Svelte, Angular…). For React,
17
- prefer the [`@seatlayer/react`](https://www.npmjs.com/package/@seatlayer/react) wrapper.
5
+ [![TypeScript](https://img.shields.io/badge/TypeScript-types%20included-3178C6.svg)](https://www.typescriptlang.org/)
6
+
7
+ The framework-agnostic SeatLayer seat map SDK for the browser. Render an
8
+ interactive seating chart or a complete seat picker, show live seat
9
+ availability, and let buyers take temporary holds on the inventory they choose.
10
+
11
+ The browser **selects and holds**; your trusted server **books**. It works in
12
+ plain HTML and in any framework.
13
+
14
+ [SeatLayer JavaScript SDK on npm](https://www.npmjs.com/package/@seatlayer/js) ·
15
+ [Buyer SDK installation guide](https://docs.seatlayer.io/buyer-sdk/install/) ·
16
+ [SeatLayer reserved-seating platform](https://seatlayer.io/) ·
17
+ [Buyer seat-map demo](https://app.seatlayer.io/demo/play/grand-theatre) ·
18
+ [SeatLayer React seat map SDK](https://www.npmjs.com/package/@seatlayer/react) ·
19
+ [SeatLayer Vue seat map SDK](https://www.npmjs.com/package/@seatlayer/vue) ·
20
+ [SeatLayer Angular seat map SDK](https://www.npmjs.com/package/@seatlayer/angular) ·
21
+ [SeatLayer AI Toolkit](https://github.com/seatlayer/seatlayer-ai-toolkit)
22
+
23
+ For React, Vue, or Angular, prefer the first-party wrapper — it is this same
24
+ runtime with the framework's own component, props, and lifecycle around it.
25
+
26
+ ## What is included
27
+
28
+ - `SeatingChart` — the headless interactive chart, mounted into an element you
29
+ own.
30
+ - `SeatPicker` — the complete buyer experience: map, legend, priced tray, hold
31
+ timer, and the checkout hand-off.
32
+ - `EmbeddedDesigner` — a hosted chart Designer inside your own application.
33
+ - `SeatManager` and `ManageApi`, from the `@seatlayer/js/manager` subpath — the
34
+ organizer control room and event-scoped inventory client.
35
+ - `attachPickerFrame` — the host-side iframe helper for embedded pickers.
36
+ - TypeScript declarations for ESM (`dist/index.d.ts`) and CommonJS
37
+ (`dist/index.d.cts`), for the root and the `./manager` subpath.
38
+
39
+ ## Requirements
40
+
41
+ - A browser DOM. Give the container a definite height; the chart sizes itself
42
+ to its container, not to the viewport.
43
+ - No framework, build step, or peer dependency is required.
18
44
 
19
45
  ## Install
20
46
 
@@ -22,7 +48,19 @@ prefer the [`@seatlayer/react`](https://www.npmjs.com/package/@seatlayer/react)
22
48
  npm install @seatlayer/js
23
49
  ```
24
50
 
25
- ## Usage
51
+ No build tool? Load the hosted bundle instead — it exposes a `seatlayer`
52
+ global. Pin an exact version in production; the major alias always redirects to
53
+ the newest release in that line.
54
+
55
+ ```html
56
+ <div id="picker" style="width: 100%; height: 640px"></div>
57
+ <script src="https://cdn.seatlayer.io/seatlayer-js@0/seatlayer.js"></script>
58
+ <script>
59
+ new seatlayer.SeatPicker({ container: '#picker', event: 'ev_9f3a' }).render();
60
+ </script>
61
+ ```
62
+
63
+ ## Quick start
26
64
 
27
65
  ```js
28
66
  import { SeatingChart } from '@seatlayer/js';
@@ -39,6 +77,52 @@ const hold = await chart.hold(); // null on a 409 conflict
39
77
  chart.destroy();
40
78
  ```
41
79
 
80
+ ## Fixed Renewable Season (private-beta candidate)
81
+
82
+ The Season source is merged for development, but it is not included in the
83
+ currently registered stable package. The validated out-of-band candidate is
84
+ `0.67.0-season-s08.0`; the npm badge and install command above describe the
85
+ stable registered package and do not prove this candidate is published.
86
+
87
+ `SeasonPicker` is a distinct fixed-inclusion surface. Your server mints a
88
+ short-lived `bss_` session for the browser's exact Origin; keep that token in
89
+ memory. The picker returns an opaque, price-free handoff with the immutable Plan
90
+ activation, stable operation/hold identities, expiry/policy, and per-occurrence
91
+ outcomes. Inspect and book it from trusted server code.
92
+
93
+ ```js
94
+ import { SeasonPicker } from '@seatlayer/js';
95
+
96
+ const picker = new SeasonPicker({
97
+ container: '#season',
98
+ season: 'sea_2027',
99
+ buyerAccessToken: session.token,
100
+ onContinue: (handoff) => continueOnYourServer(handoff.operationId),
101
+ });
102
+ await picker.render();
103
+ await picker.holdSameSeat(['A-1'], 'sop_checkout_1183');
104
+
105
+ // Caller-stable and exact-replayable. Do not invent a new id after uncertainty.
106
+ await picker.release('sra_checkout_1183');
107
+
108
+ // Returning-holder journey: this records browser intent only. It never proves
109
+ // price, payment, an order, or a renewed Contract; your trusted backend must
110
+ // inspect and commit the exact offer with a caller-stable action ID.
111
+ const intent = await picker.createRenewalIntent('sro_returning_holder_1183');
112
+ sendIntentToYourBackend(intent);
113
+ ```
114
+
115
+ Supply `initialOperationId` to restore a lost create response. Pending operations
116
+ are polled through their retained operation URL; `partial_terminal` stays visible
117
+ and must be reconciled rather than replaced with a blind new action. This is an
118
+ unpublished private-beta candidate, not the currently registered npm package.
119
+
120
+ The private-beta claim is this framework-agnostic JavaScript `SeasonPicker`
121
+ only. `@seatlayer/react`, `@seatlayer/vue`, `@seatlayer/angular`, React Native,
122
+ Flutter, iOS, and Android do not expose a verified Season wrapper and are
123
+ explicitly unsupported for this candidate. A host may mount this plain-JS
124
+ surface inside a framework, but that does not create a wrapper support claim.
125
+
42
126
  ## Use in any framework
43
127
 
44
128
  The SDK only needs a DOM element and mount/unmount hooks:
@@ -51,6 +135,27 @@ onUnmounted(() => chart?.destroy());
51
135
 
52
136
  Svelte → `onMount` / `onDestroy`. Angular → `ngAfterViewInit` / `ngOnDestroy`.
53
137
 
138
+ First-party wrappers exist for the three largest frameworks and are built on
139
+ this package: [`@seatlayer/react`](https://www.npmjs.com/package/@seatlayer/react),
140
+ [`@seatlayer/vue`](https://www.npmjs.com/package/@seatlayer/vue), and
141
+ [`@seatlayer/angular`](https://www.npmjs.com/package/@seatlayer/angular).
142
+
143
+ ## Security boundary
144
+
145
+ The browser **selects and holds** inventory. Your trusted backend **inspects and
146
+ books** the hold after payment or order validation.
147
+
148
+ - Never expose a SeatLayer secret key in browser code or a bundled environment
149
+ variable.
150
+ - Send only the `holdId` and your normal checkout context to your backend.
151
+ - Calculate the charge from server-inspected hold items, not from browser input.
152
+ - Reuse your stable order id as `bookingRef` so a retried booking is idempotent.
153
+ - Organizer surfaces take a short-lived, event-scoped `mse_` browser grant held
154
+ in memory — never a tenant `sk_` secret, never a URL, storage, or log.
155
+
156
+ Read [how the integration works](https://docs.seatlayer.io/start/how-it-works/)
157
+ before connecting checkout.
158
+
54
159
  ## Embed the live control room
55
160
 
56
161
  `SeatManager` gives first-party dashboards and external platforms the same
@@ -304,17 +409,93 @@ Two limits worth knowing before switching it on:
304
409
  rather than back in your embed. In-page gateways never navigate away and
305
410
  confirm in place, as does an embed running on an allowed origin.
306
411
 
307
- ## Related resources
308
-
309
- - [Buyer SDK documentation](https://docs.seatlayer.io/buyer-sdk/install/)
310
- - [SeatingChart reference](https://docs.seatlayer.io/buyer-sdk/seating-chart/)
311
- - [Holds and checkout](https://docs.seatlayer.io/buyer-sdk/holds-and-checkout/)
312
- - [Complete checkout example](https://docs.seatlayer.io/examples/complete-checkout/)
313
- - [`@seatlayer/react`](https://www.npmjs.com/package/@seatlayer/react)
314
- - [React Native SDK](https://github.com/seatlayer/seatlayer-react-native)
315
- - [iOS SDK](https://github.com/seatlayer/seatlayer-ios)
316
- - [Flutter package](https://pub.dev/packages/seatlayer)
317
- - [Agent-readable documentation](https://docs.seatlayer.io/llms.txt)
412
+ ## Frequently asked questions
413
+
414
+ ### What is the best JavaScript library for seat maps and seat booking?
415
+
416
+ That depends on what you need to own. This package is a complete reserved-seating
417
+ runtime: it draws the venue, shows live availability, enforces selection rules,
418
+ and takes temporary holds that stop two buyers from taking the same seat. A
419
+ generic drawing library is lighter if you only need pictures of seats; the live
420
+ inventory, holds, and server-side booking are the parts SeatLayer provides, and
421
+ the same event also renders through the React, Vue, Angular, and native mobile
422
+ SDKs.
423
+
424
+ ### How do I add a seat map to a plain JavaScript page?
425
+
426
+ Load the hosted bundle with a `<script>` tag or install `@seatlayer/js`, give a
427
+ container a definite height, construct `SeatPicker` or `SeatingChart` with your
428
+ event key, and call `render()`. The install snippet above is the whole
429
+ integration; the
430
+ [buyer SDK installation guide](https://docs.seatlayer.io/buyer-sdk/install/)
431
+ covers options, events, and the framework variants.
432
+
433
+ ### Does it render in the page or in an iframe?
434
+
435
+ `SeatPicker` and `SeatingChart` render directly into the element you give them,
436
+ so your own styles and layout apply. Embedding in an iframe is supported too —
437
+ `attachPickerFrame` wires the host side of the resize and fullscreen protocol,
438
+ verifying the message origin. The organizer Designer is deliberately
439
+ iframe-only, so no Designer credential ever reaches the host bundle.
440
+
441
+ ### How do temporary seat holds work?
442
+
443
+ When a buyer commits to a selection, `hold()` reserves that inventory against
444
+ concurrent buyers for a limited checkout window and returns an opaque `holdId`.
445
+ The hold lapses on its own if checkout never completes, `resumeHold()` restores
446
+ it after a same-tab checkout navigation or a reload, and `releaseLabels()` gives
447
+ back part of it. This is what prevents double-selling without locking seats
448
+ forever.
449
+
450
+ ### Can I use my own payment provider?
451
+
452
+ Yes. By default no payment code is downloaded at all. The widget hands your code
453
+ a `holdId` and a self-contained `CheckoutHandoff` with priced line items, your
454
+ backend charges through whatever provider you already use, and it then books the
455
+ hold through the
456
+ [server-side checkout flow](https://docs.seatlayer.io/buyer-sdk/holds-and-checkout/).
457
+ The opt-in `checkout: 'hosted'` mode documented above exists only for hosts with
458
+ no backend.
459
+
460
+ ### Are TypeScript types included?
461
+
462
+ Yes. The package ships its own declarations for ESM and CommonJS, for both the
463
+ root entry and the `@seatlayer/js/manager` subpath — there is no `@types/*`
464
+ package to add. Declarations are validated at release by `publint` and
465
+ `arethetypeswrong`.
466
+
467
+ ## Continue your JavaScript integration
468
+
469
+ - [Follow the buyer SDK installation guide](https://docs.seatlayer.io/buyer-sdk/install/)
470
+ for the hosted script, ESM, and framework variants.
471
+ - [Read the SeatingChart reference](https://docs.seatlayer.io/buyer-sdk/seating-chart/)
472
+ for the complete chart API.
473
+ - [Connect seat holds to secure server-side checkout](https://docs.seatlayer.io/buyer-sdk/holds-and-checkout/)
474
+ without putting booking credentials in the browser.
475
+ - [Run the complete checkout example](https://docs.seatlayer.io/examples/complete-checkout/)
476
+ to connect a buyer hold id to payment and idempotent booking.
477
+ - [Compare SeatLayer's mobile seat map SDKs](https://docs.seatlayer.io/buyer-sdk/mobile/)
478
+ when the same event also has to render in native apps.
479
+ - [Read the embedded Designer guide](https://docs.seatlayer.io/platform/embedded-designer/)
480
+ to let organizers draw their own venues inside your product.
481
+ - [Explore the 3D seating chart](https://seatlayer.io/3d-seat-map/) for the
482
+ interactive venue view buyers can switch to from the map.
483
+ - [Point AI coding agents at the SeatLayer docs index](https://docs.seatlayer.io/llms.txt)
484
+ (`llms.txt`) for an agent-readable map of the documentation.
485
+
486
+ ## SeatLayer SDK ecosystem
487
+
488
+ | Surface | Package or source |
489
+ | --- | --- |
490
+ | JavaScript | [`@seatlayer/js`](https://www.npmjs.com/package/@seatlayer/js) (this package) |
491
+ | React | [`@seatlayer/react`](https://www.npmjs.com/package/@seatlayer/react) |
492
+ | Vue | [`@seatlayer/vue`](https://www.npmjs.com/package/@seatlayer/vue) |
493
+ | Angular | [`@seatlayer/angular`](https://www.npmjs.com/package/@seatlayer/angular) |
494
+ | React Native | [`@seatlayer/react-native`](https://www.npmjs.com/package/@seatlayer/react-native) |
495
+ | iOS | [`seatlayer-ios`](https://github.com/seatlayer/seatlayer-ios) |
496
+ | Flutter | [`seatlayer`](https://pub.dev/packages/seatlayer) |
497
+ | Android | [`seatlayer-android`](https://github.com/seatlayer/seatlayer-android) |
498
+ | Server SDKs | [Node.js, Python, PHP, Ruby, .NET, Java, and Go](https://docs.seatlayer.io/server-sdk/install/) |
318
499
 
319
500
  ## License
320
501