@@ -71,6 +71,47 @@ await seatlayer.inventory.bookBestAvailable(eventKey, { qty: 2, bookingRef: 'pho
7171await seatlayer .inventory .boxOfficeBook (eventKey , { labels: [' A-1' , ' A-2' ], bookingRef: ' comp-14' });
7272```
7373
74+ ## Listing and pagination
75+
76+ ` list() ` returns one page plus a ` nextCursor ` . When you want everything, ` listAll() ` pages for you
77+ and yields as it goes — an async iterator rather than an array, because the point of paginating is
78+ to * not* hold an unbounded list in memory.
79+
80+ ``` ts
81+ // One page, your own paging.
82+ const page = await seatlayer .events .list ({ limit: 50 });
83+ page .events ; // EventMeta[]
84+ page .nextCursor ; // undefined once exhausted
85+
86+ // Or let the SDK walk it.
87+ for await (const event of seatlayer .events .listAll ()) {
88+ await sync (event );
89+ }
90+ ```
91+
92+ Listing events includes live availability ` counts ` by default, which costs the server one
93+ round-trip ** per event** . ` listAll() ` turns them off automatically — walking a whole catalogue is
94+ exactly when you don't want that — and you can control it explicitly:
95+
96+ ``` ts
97+ await seatlayer .events .list ({ limit: 50 , counts: false });
98+ ```
99+
100+ ## Keeping a hold alive
101+
102+ When an order takes longer than the checkout window — an invoice, a phone sale — extend rather than
103+ release and re-hold. Releasing first hands the seats to whoever is racing for them in between.
104+
105+ ``` ts
106+ try {
107+ await seatlayer .inventory .extendHold (eventKey , { holdId , ttlMs: 10 * 60_000 });
108+ } catch (error ) {
109+ if (error instanceof SeatLayerConflictError ) {
110+ // Gone, expired, or at its renewal cap — the buyer has to re-pick.
111+ }
112+ }
113+ ```
114+
74115## Embedding the control room
75116
76117Your secret key never reaches a browser. Mint a scoped token instead and hand that to the widget.
@@ -116,9 +157,9 @@ app.post('/webhooks/seatlayer', express.raw({ type: 'application/json' }), (req,
116157 secret: process .env .SEATLAYER_WEBHOOK_SECRET ! ,
117158 });
118159
119- // Deliveries are signed over the body only — there is no timestamp header
120- // and no tolerance window, so a captured delivery stays valid. Deduplicate
121- // on occurrenceId; this is your replay protection.
160+ // The signed body carries `at`, but nothing enforces a freshness window,
161+ // so a captured delivery stays valid indefinitely . Deduplicate on
162+ // occurrenceId — this is your replay protection, not an optimisation .
122163 if (await alreadyProcessed (event .occurrenceId )) return res .sendStatus (200 );
123164
124165 await handle (event );
@@ -191,9 +232,9 @@ await seatlayer.request('POST', '/v1/events/ev_1/some-new-route', { body: { …
191232
192233| Resource | Methods |
193234| --- | --- |
194- | ` charts ` | ` list ` ` create ` ` retrieve ` ` update ` ` delete ` ` copy ` ` archive ` ` unarchive ` ` publish ` |
195- | ` events ` | ` list ` ` create ` ` retrieve ` ` update ` ` delete ` ` updateChart ` ` close ` ` reopen ` ` archive ` ` retrieveHoldTtl ` ` updateHoldTtl ` ` retrieveReport ` ` retrieveLog ` |
196- | ` inventory ` | ` hold ` ` holdBestAvailable ` ` bookBestAvailable ` ` retrieveHold ` ` release ` ` book ` ` boxOfficeBook ` ` unbook ` ` block ` ` unblock ` ` unblockAll ` ` retrieveAvailability ` ` updateAvailability ` |
235+ | ` charts ` | ` list ` ` listAll ` ` create ` ` retrieve ` ` update ` ` delete ` ` copy ` ` archive ` ` unarchive ` ` publish ` |
236+ | ` events ` | ` list ` ` listAll ` ` create ` ` retrieve ` ` update ` ` delete ` ` updateChart ` ` close ` ` reopen ` ` archive ` ` retrieveHoldTtl ` ` updateHoldTtl ` ` retrieveReport ` ` retrieveLog ` |
237+ | ` inventory ` | ` hold ` ` holdBestAvailable ` ` bookBestAvailable ` ` extendHold ` ` retrieveHold ` ` release ` ` book ` ` boxOfficeBook ` ` unbook ` ` block ` ` unblock ` ` unblockAll ` ` retrieveAvailability ` ` updateAvailability ` |
197238| ` sessions ` | ` createManageSession ` ` revokeManageSession ` ` createDesignerSession ` ` revokeDesignerSession ` |
198239| ` webhooks ` | ` list ` ` create ` ` update ` ` delete ` ` listDeliveries ` |
199240| ` workspaces ` | ` list ` ` create ` ` retrieve ` ` update ` |
0 commit comments