@lockerverse/react 0.2.156 → 0.2.157

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
@@ -7,6 +7,17 @@ project, use its local README, `package.json` exports, and public `.d.ts` files.
7
7
  Online examples can describe a newer release. Do not import private `dist`
8
8
  modules or copy API details from a different SDK version.
9
9
 
10
+ ## Version-matched integration guides
11
+
12
+ Read [shared integration rules](guides/integration.md) first, then the guide for
13
+ [auctions](guides/auctions.md), [payment widgets](guides/payment-widgets.md),
14
+ [Events](guides/events.md), or [signup](guides/signup.md). These are stable files
15
+ inside the installed package: `node_modules/@lockerverse/react/guides/`.
16
+ They ship with this release and are generated from the maintained documentation.
17
+ Admin prompts supply public resource identity and a minimum SDK version; they
18
+ do not duplicate these rules. Keep a newer matching stable SDK pair instead of
19
+ downgrading it. Read the installed guides and public types before implementation.
20
+
10
21
  ## Usage guide
11
22
 
12
23
  - [Install](#install) and [payment quick start](#use)
@@ -693,63 +704,9 @@ plural options type is also exported from `auctions`.
693
704
 
694
705
  ## Public event listings
695
706
 
696
- Use the public Events entry to show publicly listed Events that are happening
697
- now, start in the future, or have ended. It does not load ticket or payment UI.
698
-
699
- ```tsx
700
- import {
701
- LockerversePublicEvents,
702
- useLockerversePublicEvents,
703
- } from "@lockerverse/react/public-events";
704
- import "@lockerverse/react/public-events.css";
705
-
706
- function CommunityEvents() {
707
- const events = useLockerversePublicEvents({ communitySlug: "auburn" });
708
- return <LockerversePublicEvents events={events} title="Events" theme="light" />;
709
- }
710
- ```
711
-
712
- The hook returns `client`, `events`, `loading`, `error`, and `refresh`. The
713
- component takes the full hook result so it can show loading, empty, and retry
714
- states. `title` sets the visible heading, `showHeading` can hide it, and
715
- `timeZone` controls date display. The default time zone is
716
- `America/New_York`. Use `style` with `LockerverseStyle` tokens or `className`
717
- to match the host site. Links open in a new tab when they use HTTP or HTTPS.
718
- Events can include an optional `imageUrl`. The list uses image cards when an
719
- image is present and a date tile when it is absent. The default view groups
720
- events into "Happening now" and "Upcoming". The "Past Events" view loads on
721
- demand and offers "Load more" for older events. Each card has a share action.
722
- Sharing uses the event link when one exists; otherwise it uses a link to the
723
- event card on the host page. For a one-list view, a card link can load up to
724
- five more pages to find its Event. The visitor can still use Load more.
725
-
726
- Pass one configuration object to the hook for a different list. The component
727
- reads that configuration from the hook result. With `showTabs: false`, it shows
728
- one full-width list; `includePast` selects whether that list includes ended
729
- Events. `from`, `to`, and `sort` set the server-side date range and order.
730
- Without `from` or `to`, a one-list view reads all publicly listed Event
731
- history. It includes past Events by default and sorts by descending start
732
- time, so newer Events appear first. With `includePast: false`, the default is
733
- ascending start time for current and future Events. Each page has 20 Events.
734
-
735
- ```tsx
736
- const config = {
737
- showTabs: false,
738
- includePast: true,
739
- from: "2026-09-01T00:00:00.000Z",
740
- to: "2026-10-01T00:00:00.000Z",
741
- sort: "startAtAsc",
742
- } as const;
743
- const events = useLockerversePublicEvents(
744
- { communitySlug: "auburn" },
745
- { config, initialPage }
746
- );
747
- return <LockerversePublicEvents events={events} />;
748
- ```
749
-
750
- For server rendering, obtain `initialPage` with the SDK client's `search()`
751
- and the same date, scope, sort, and page size. Without this configuration,
752
- `initialEvents` from `list()` keeps the original Upcoming and Past views.
707
+ Read the version-matched [Events integration guide](guides/events.md) for
708
+ `useLockerversePublicEvents`, list configuration, server seeds, and public
709
+ attendee lists. It is generated from the maintained Events documentation.
753
710
 
754
711
  ## Prefill checkout custom fields
755
712
 
@@ -0,0 +1,547 @@
1
+ # Lockerverse auctions guide
2
+
3
+ Package: @lockerverse/react@0.2.157
4
+
5
+ Generated from this release's maintained documentation. Do not edit this copy.
6
+
7
+ Read [the shared integration guide](integration.md) first.
8
+
9
+ ## Auctions
10
+
11
+ Use the [auction example](https://sdk.lockerverse.com/examples/auctions) to browse live data and view the complete source.
12
+
13
+ ## Shared Lockerverse interface
14
+
15
+ The optional auction UI follows the public Lockerverse web app: image cards and status filters, a photo gallery with a full-screen viewer, item details, and a two-step bid or purchase checkout. It uses the community color by default. Override the shared theme variables with `style` when the host site needs different branding.
16
+
17
+ The item layout responds to its container width, so the same component can fill a page or sit inside a narrow embed. The SDK supplies its own scoped CSS and does not require Next.js or Tailwind. Dates follow the public app's America/New_York display policy and honor each auction's time-display settings.
18
+
19
+ For public item pages, pass `backHref` to `LockerverseAuctionItem` so its return controls are real links. Add `onBack` to connect ordinary clicks to the host router or item selection; modified clicks keep native browser behavior. `onBack` without `backHref` keeps the existing button controls. Pass `communityName` only when the host needs to override the API community name. Keep the catalog mounted but hidden while showing an item to preserve the selected auction and filter. The example demonstrates this pattern.
20
+
21
+ Pass `returnToItemHref` to add a **Return to item** link after a completed bid or purchase. It opens the item URL as a fresh page visit. When `backHref` or `onBack` is also supplied, **View auction items** remains as the secondary action. The completed result uses `backHref` as a fresh page visit when it is set. The link does not reset or resume checkout in the mounted component. Hosts that restore purchase recovery must clear completed recovery before a new page visit.
22
+
23
+ For internal adoption, import these same SDK components and stylesheet. Keep routing, page metadata, and the site header in the app. Change auction presentation in the SDK rather than copying its markup or styles into a second implementation. The host owns route URLs, metadata, and page chrome; the SDK owns the shared auction presentation.
24
+
25
+ ## Choose your UI
26
+
27
+ - `@lockerverse/sdk/auctions`: framework-independent clients, validated data, pricing estimates, bids, purchases, and status lookup.
28
+ - `@lockerverse/react/auctions`: `useLockerverseAuctions` and the optional `LockerverseAuctions` catalog. This entry does not import Stripe.
29
+ - `@lockerverse/react/auction-data`: the React data hook only, with no UI, icons, or Stripe.
30
+ - `@lockerverse/react/auction`: one loaded auction and its item cards, without the community auction list or checkout.
31
+ - `@lockerverse/react/auction-item`: optional `LockerverseAuctionItem` detail and card checkout.
32
+ - `@lockerverse/react/auction.css`: catalog and single-auction styles only.
33
+ - `@lockerverse/react/auction-item.css`: item details, gallery, and checkout styles only.
34
+ - `@lockerverse/react/auctions.css`: all auction styles, retained for existing integrations.
35
+
36
+ ```tsx
37
+ import { LockerverseAuctions, useLockerverseAuctions } from "@lockerverse/react/auctions";
38
+ import { LockerverseAuctionItem } from "@lockerverse/react/auction-item";
39
+ import "@lockerverse/react/auctions.css";
40
+
41
+ const auctions = useLockerverseAuctions({ communitySlug: "auburn" });
42
+
43
+ // In your component, keep the selected auction and item in application state.
44
+ <LockerverseAuctions
45
+ auctions={auctions}
46
+ onSelectItem={(auction, item) => setSelection({ auction, itemId: item.id })}
47
+ theme="light"
48
+ />;
49
+
50
+ // Render only when selection exists. Remount when its resource identity changes.
51
+ <LockerverseAuctionItem
52
+ key={`${selection.auction.id}:${selection.itemId}`}
53
+ auction={selection.auction}
54
+ client={auctions.client}
55
+ itemId={selection.itemId}
56
+ onBidSubmitted={handleBidSubmitted}
57
+ onPurchaseComplete={handlePurchaseComplete}
58
+ theme="light"
59
+ />;
60
+ ```
61
+
62
+ Install the same optional Stripe peers as the payment component:
63
+
64
+ ```sh
65
+ npm install @lockerverse/react react react-dom @stripe/react-stripe-js @stripe/stripe-js
66
+ ```
67
+
68
+ Production is the default. For development, explicitly pass `environment: "development"` and the development `apiBaseUrl`.
69
+
70
+ ## Serve auction images through your site
71
+
72
+ Set `mediaBaseUrl` to an absolute HTTPS URL when your host has a fixed server rewrite to `https://media.lockerverse.com`. For example, configure `/lockerverse-media/:path*` on your host to forward to `https://media.lockerverse.com/:path*`, then pass:
73
+
74
+ ```tsx
75
+ const auctions = useLockerverseAuctions({
76
+ communitySlug: "wsu",
77
+ mediaBaseUrl: "https://your-site.example/lockerverse-media",
78
+ });
79
+ ```
80
+
81
+ This option also works with `useLockerverseAuction` and `createLockerverseAuctionClient`. It changes Lockerverse auction, community, and item image URLs on every list, load, and refresh. Other image hosts keep their original URLs. Without this option, all image URLs stay unchanged. The host must configure the rewrite before using the option; the SDK does not create it.
82
+
83
+ ## A page for one auction
84
+
85
+ Use `LockerverseAuction` when the host already knows which auction to show. It goes straight to that auction's items, without an intermediate auction-list card. Use `useLockerverseAuction(options, auctionSlug)` from `@lockerverse/react/auction-data` for a dedicated page. It calls `client.load(auctionSlug)` directly and never requests the community auction list. The host handles initial loading, errors, and missing auctions before rendering this component.
86
+
87
+ ```tsx
88
+ import { LockerverseAuction } from "@lockerverse/react/auction";
89
+ import "@lockerverse/react/auction.css";
90
+
91
+ // auction is a validated, loaded Lockerverse auction.
92
+ <LockerverseAuction
93
+ auction={auction}
94
+ onSelectItem={(auction, item) => openItem(auction, item.id)}
95
+ showFilters={false}
96
+ showHeader={false}
97
+ showLineup={false}
98
+ theme="light"
99
+ />;
100
+ ```
101
+
102
+ `showFilters` and `showHeader` default to `true`. `showLineup` defaults to `false`, so the static introduction and separate count are hidden. These options also work on `LockerverseAuctions`. The auction header omits the auction date range; item dates remain on item cards. Hiding filters shows all items and clears the previous filter. Changing the auction resets its filter. Hiding headings never removes the section's accessible name. `onBack` is optional, so a dedicated auction page does not need a link to all auctions.
103
+
104
+ ### Direct loading and refresh
105
+
106
+ ```tsx
107
+ import { useLockerverseAuction } from "@lockerverse/react/auction-data";
108
+
109
+ const resource = useLockerverseAuction(
110
+ { communitySlug: "lckrvrs-internal" },
111
+ "auction"
112
+ );
113
+ ```
114
+
115
+ The result contains `client`, `auction`, `loading`, `error`, and `refresh()`. Without an initial seed, initial loading has no auction. Refresh keeps the last successful snapshot, including when the request fails. Show a refresh error beside the existing UI. Show a retry button only when loading fails; do not add a manual refresh button to the normal auction view. Community, auction slug, environment, API base URL, and media base URL are immutable: use a new React key when the resource identity changes.
116
+
117
+ Both data hooks refresh by default after the document changes from hidden to visible. They do not poll, refresh on mount twice, or reload the page. Disable this policy when the host supplies its own refresh:
118
+
119
+ ```tsx
120
+ useLockerverseAuction(options, "auction", { refreshOnReturn: false });
121
+ useLockerverseAuctions(options, { refreshOnReturn: false });
122
+ ```
123
+
124
+ The React-only `AuctionRefreshOptions` type is exported from `auction-data` and `auctions`. Both hooks retain their last successful data during a refresh or failure. Return events during an in-flight read coalesce into at most one later read while visible. Manual refresh still works; older responses cannot replace newer data. Return refresh updates display data, never a bid or payment result. Checkout still reviews server pricing before submission. Use the local [State Lab](https://sdk.lockerverse.com/examples/state-lab) response controls to stage prices, stock, missing items, errors, or independently paused reads. No real bid or charge occurs there.
125
+
126
+ Try the [complete single-auction example](https://sdk.lockerverse.com/examples/auctions?community=lckrvrs-internal&auction=auction). Its copyable source is self-contained. Community, auction, and item links use native document navigation with `community`, `auction`, and `item` query parameters; existing host parameters are preserved. Direct item links support reload, Back/Forward, new tabs, item-not-found handling, and return to the loaded auction. The community/auction form clears the old item selection. It reads the link before mounting a data hook, so the first request is the auction detail request. An empty auction slug selects the separate all-auctions example.
127
+
128
+ `LockerverseAuctionItem` accepts fresh same-ID data while selecting an item. Once payment is open, it preserves the transaction snapshot until the user returns to selection. Checkout's own server review takes precedence over an older host snapshot. Keep a selected item mounted during refresh, errors, and item disappearance while a submission or recovery is locked; a loading or not-found branch must never discard it.
129
+
130
+ For Lovable, start with the built-in styled UI and supported public configuration. Do not automatically switch to headless based on inferred design needs. Use the headless SDK only when a custom implementation is explicitly requested.
131
+
132
+ ### Initial server data
133
+
134
+ Pass a complete SDK snapshot to the React hook when a server route has already
135
+ loaded it. The plural hook accepts `initialAuctions` in its second argument;
136
+ the singular hook accepts `initialAuction` in its third argument.
137
+
138
+ ```tsx
139
+ import type { LockerverseAuction } from "@lockerverse/sdk/auctions";
140
+ import {
141
+ useLockerverseAuction,
142
+ useLockerverseAuctions,
143
+ } from "@lockerverse/react/auction-data";
144
+
145
+ function useServerAuctions(
146
+ communitySlug: string,
147
+ initialAuctions: LockerverseAuction[]
148
+ ) {
149
+ return useLockerverseAuctions(
150
+ { communitySlug },
151
+ { initialAuctions }
152
+ );
153
+ }
154
+
155
+ function useServerAuction(
156
+ communitySlug: string,
157
+ auctionSlug: string,
158
+ initialAuction: LockerverseAuction
159
+ ) {
160
+ return useLockerverseAuction(
161
+ { communitySlug },
162
+ auctionSlug,
163
+ { initialAuction }
164
+ );
165
+ }
166
+ ```
167
+
168
+ The seed is read once on mount. An empty `initialAuctions: []` is valid data.
169
+ The seed must belong to the requested community; a singular seed with a
170
+ different auction slug throws a `TypeError`. Later seed prop changes do not
171
+ replace live data. The hook does not mutate the supplied snapshot.
172
+
173
+ The first browser request still runs, and `loading` remains true while it is
174
+ pending. Render available data during loading; show an initial skeleton only
175
+ when data is null. A failed refresh retains the seed or last successful data.
176
+ Keep checkout mounted during refresh and errors. `refreshOnReturn` remains
177
+ available in the same argument. The named `UseLockerverseAuctionOptions` and
178
+ `UseLockerverseAuctionsOptions` types are exported from `auction-data`; the
179
+ plural options type is also exported from `auctions`.
180
+
181
+ ## Keep the default cards, change selected parts
182
+
183
+ The built-in card supports `showDescription`, `showMetrics`, and `showTiming` (all default to `true`), plus `className` and `style`. Use `renderItem` to change these without copying card markup:
184
+
185
+ ```tsx
186
+ import {
187
+ LockerverseAuction,
188
+ LockerverseAuctionItemCard,
189
+ } from "@lockerverse/react/auction";
190
+
191
+ <LockerverseAuction
192
+ auction={auction}
193
+ onSelectItem={openItem}
194
+ renderItem={(context) => (
195
+ <LockerverseAuctionItemCard
196
+ {...context}
197
+ showDescription={false}
198
+ showTiming={false}
199
+ />
200
+ )}
201
+ />;
202
+ ```
203
+
204
+ The card also works by itself in a host-owned list:
205
+
206
+ ```tsx
207
+ <LockerverseAuctionItemCard
208
+ auction={auction}
209
+ item={item}
210
+ onSelect={() => openItem(auction, item.id)}
211
+ theme="light"
212
+ showDescription={false}
213
+ />;
214
+ ```
215
+
216
+ It supplies a lightweight theme scope. Its `className` and `style` apply to that outer scope. Import `@lockerverse/react/auction.css` once for the host list.
217
+
218
+ Or return your own card. The renderer receives `auction`, `item`, the effective `status`, `onSelect`, `theme`, and inherited theme variables in `style`. Spread this context onto the default card to retain branding. It renders inside an SDK-owned list item; do not return another `<li>`. Keep a keyboard-accessible button or link connected to the supplied action. Render hooks inside a custom React component, not directly inside the render callback. Returning `null` intentionally renders no card.
219
+
220
+ A custom card can still open `LockerverseAuctionItem` for the built-in item, closed-state, bid, checkout, and recovery flows. Presentation options do not bypass availability or payment rules. Keep uncertainty and recovery information visible. Fully custom flows can continue to use the unchanged headless SDK.
221
+
222
+ ## Host styling and layout
223
+
224
+ Auction components have a transparent outer background and no outer padding or
225
+ maximum width. Put page padding and width limits on your host container. Card,
226
+ form, and receipt surfaces still use the shared theme variables.
227
+
228
+ Font family, font size, and date styling are configurable defaults. They are not
229
+ fixed branding rules. Pass variables through `style` or set them on the component
230
+ with a host stylesheet loaded after the SDK stylesheet:
231
+
232
+ ```tsx
233
+ <LockerverseAuction
234
+ auction={auction}
235
+ getItemHref={(auction, item) => `/auctions/${auction.path}/items/${item.path}`}
236
+ style={{
237
+ "--lockerverse-font-family": "var(--site-font, system-ui)",
238
+ "--lockerverse-font-size": "16px",
239
+ "--lockerverse-auction-title-size": "32px",
240
+ "--lockerverse-auction-card-title-size": "22px",
241
+ "--lockerverse-auction-date-size": "13px",
242
+ "--lockerverse-auction-date-transform": "none",
243
+ "--lockerverse-auction-date-letter-spacing": "normal",
244
+ }}
245
+ />
246
+ ```
247
+
248
+ The item title uses `--lockerverse-auction-item-title-size`; the result title uses
249
+ `--lockerverse-auction-result-title-size`. The receipt item title uses
250
+ `--lockerverse-auction-result-receipt-title-size`, with the general subheading size as a fallback.
251
+ General headings use
252
+ `--lockerverse-auction-heading-size` and `--lockerverse-auction-subheading-size`.
253
+ Existing color, border, radius, and font-family variables remain available.
254
+
255
+ Catalog photos are static by default. Set `autoRotateImages` on the catalog or
256
+ card to opt into rotation. Reduced-motion, focus, and hover behavior still apply.
257
+ Descriptions keep a short card preview; use `showDescription={false}` to hide it.
258
+ The full description remains available on the item page.
259
+
260
+ ## Host routes and filters
261
+
262
+ Use `getItemHref` for real item links. It preserves open-in-new-tab and ordinary
263
+ browser navigation. A host router can also handle unmodified clicks with
264
+ `onSelectItem`; modified clicks still follow the link.
265
+
266
+ Use `filter`, `onFilterChange`, and `getFilterHref` to keep the selected filter in
267
+ the URL. Omitting these props keeps the internal filter behavior. The exported
268
+ `LockerverseAuctionItemFilter` type is `all | active | draft | finished`.
269
+
270
+ For the community auction list, `getAuctionHref` supplies auction links and
271
+ `onSelectAuction` can connect an application router. Hiding filters still shows
272
+ all items. The host must keep controlled values in sync with its URL.
273
+
274
+ ## Public pages and search engines
275
+
276
+ For a public auction website, use `getItemHref` on the catalog and `backHref` on
277
+ item pages. Each URL must open the correct content on a direct visit, without
278
+ prior browser state. Use `getAuctionHref` when the site has a community auction
279
+ list. `LockerverseAuction` also accepts `backHref` for its **Auctions** control.
280
+ `LockerverseAuctions` passes `backHref` and `itemOrder` to its selected catalog.
281
+ Checkout controls that return to an earlier payment step stay buttons. Return
282
+ links in the item view stay hidden while checkout has an interaction lock.
283
+
284
+ Set `itemOrder="availability"` to show live items, then upcoming items, then
285
+ closed items. This uses the effective auction and item status, including elapsed
286
+ closing dates. Configured position and creation time still set the order within
287
+ each group. The default, `itemOrder="position"`, keeps the configured item order.
288
+
289
+ Fetch public data on the server with `createLockerverseAuctionClient().load()`.
290
+ Pass the complete result as `initialAuction` to `useLockerverseAuction`. Render
291
+ the available auction during refresh; do not replace server content with a
292
+ loading screen. The following Next.js example serves a catalog at `/auctions`:
293
+
294
+ ```tsx
295
+ // app/auctions/page.tsx — server component
296
+ import { createLockerverseAuctionClient } from "@lockerverse/sdk/auctions";
297
+ import { AuctionCatalog } from "./AuctionCatalog";
298
+
299
+ export const dynamic = "force-dynamic";
300
+
301
+ export default async function AuctionsPage() {
302
+ const initialAuction = await createLockerverseAuctionClient({
303
+ communitySlug: "your-community",
304
+ }).load("your-auction");
305
+
306
+ return <AuctionCatalog initialAuction={initialAuction} />;
307
+ }
308
+ ```
309
+
310
+ ```tsx
311
+ // app/auctions/AuctionCatalog.tsx — rendered on the server, then hydrated
312
+ "use client";
313
+
314
+ import type { LockerverseAuction as Auction } from "@lockerverse/sdk/auctions";
315
+ import { LockerverseAuction } from "@lockerverse/react/auction";
316
+ import { useLockerverseAuction } from "@lockerverse/react/auction-data";
317
+ import "@lockerverse/react/auction.css";
318
+
319
+ export function AuctionCatalog({ initialAuction }: { initialAuction: Auction }) {
320
+ const { auction, error } = useLockerverseAuction(
321
+ { communitySlug: "your-community" },
322
+ initialAuction.slug,
323
+ { initialAuction }
324
+ );
325
+
326
+ return (
327
+ <>
328
+ <h1>Auctions and experiences</h1>
329
+ {error ? <p role="status">Auction updates are temporarily unavailable.</p> : null}
330
+ <LockerverseAuction
331
+ auction={auction ?? initialAuction}
332
+ getItemHref={(_, item) => `/auctions/items/${encodeURIComponent(item.slug)}`}
333
+ itemOrder="availability"
334
+ showHeader={false}
335
+ />
336
+ </>
337
+ );
338
+ }
339
+ ```
340
+
341
+ Create the matching item route with server data too. Resolve the item from the
342
+ auction before its first render, then pass `backHref="/auctions"` and its own
343
+ `returnToItemHref` to `LockerverseAuctionItem`. Keep the mounted item during
344
+ refresh and payment, as described in **Initial server data**. Use a real 404
345
+ response for unknown items. Do not include unlisted preview items in public
346
+ catalogs or sitemaps.
347
+
348
+ The host website owns document metadata and HTTP routes. For every public auction
349
+ and item route, the host must provide a unique title and description, an absolute
350
+ canonical URL, and server-rendered content. Publish `/sitemap.xml` with the public
351
+ canonical URLs, reference it from `/robots.txt`, and submit it in Search Console.
352
+ The SDK cannot select the host's domain, router, indexing policy, or page title.
353
+ Use verified organization and breadcrumb data for structured data. Add product
354
+ and offer data only when it matches the visible item and sale terms; a current
355
+ bid is not a fixed purchase price.
356
+
357
+ ## Shared results
358
+
359
+ The item component shows the shared result after a confirmed bid submission or
360
+ paid purchase. Completion callbacks remain available for host routing and data
361
+ refresh. The result is also available separately:
362
+
363
+ ```tsx
364
+ import { LockerverseAuctionResult } from "@lockerverse/react/auction-result";
365
+ import "@lockerverse/react/auction-result.css";
366
+ ```
367
+
368
+ Use the purchase confirmation only after the server reports a paid purchase.
369
+ Receipt amounts alone do not establish payment status. A submitted bid is not a
370
+ winning bid or a payment. Keep unknown and pending transactions mounted until
371
+ their result is resolved.
372
+
373
+ ## Icons and bundle boundaries
374
+
375
+ Auction UI uses the same Lucide icon definitions as the original Lockerverse app. Each component uses static named imports. There is no dynamic icon-name registry, and text characters are not used as navigation icons.
376
+
377
+ Import the smallest public entry you need. The core `@lockerverse/sdk/auctions` entry has no React, icons, or UI styles. The React data hook also has no UI imports. The single-auction view does not import the multi-auction browser or Stripe. Item details do not import the catalog; they include their gallery and checkout dependencies. CSS is opt-in through the matching stylesheet above.
378
+
379
+ A prop such as `showFilters={false}` removes the controls at runtime; it is not a promise that a bundler removes all filter code. Use separate entries for bundle isolation, and use a custom card or the headless API for a substantially different interface.
380
+
381
+ ## Custom UI
382
+
383
+ ```ts
384
+ import { createLockerverseAuctionClient } from "@lockerverse/sdk/auctions";
385
+
386
+ const client = createLockerverseAuctionClient({ communitySlug: "auburn" });
387
+ const auctions = await client.list();
388
+ const auction = await client.load("auburn-auction");
389
+ ```
390
+
391
+ The auction includes its items, bidding and quantity rules, fee policy, and payment configuration. Read prices and availability from this response. All amounts are integer USD cents. The server validates the final bid and purchase.
392
+
393
+ The core methods `createBid` and `createPurchase` accept a Stripe confirmation token created on the returned payment account. Bid card collection uses Stripe setup mode and off-session use. Buy-now checkout uses payment mode. The ready-made component handles these steps for card payments, including billing and required shipping addresses.
394
+
395
+ For custom card-only buy-now Elements, set `paymentMethodTypes: ["card"]` both on Elements and in the `createPurchase` submission. Omit the submission field for automatic payment methods. Include `params.return_url` when creating the confirmation token. The ready-made component handles this configuration.
396
+
397
+ ## Host navigation and submission locks
398
+
399
+ Connect `onInteractionLockChange(locked)` to every host control that can remove or replace checkout: back links, community selection, router navigation, and reset buttons. `true` covers preparation, a sent operation, and unresolved bid or purchase recovery. The SDK sends the lock before starting submission and releases it when safe; its own back controls follow the same lock.
400
+
401
+ ```tsx
402
+ <LockerverseAuctionItem
403
+ auction={auction}
404
+ client={client}
405
+ itemId={itemId}
406
+ onInteractionLockChange={setCheckoutLocked}
407
+ onBack={checkoutLocked ? undefined : closeItem}
408
+ onUncertain={(kind) => setMessage(`The ${kind} result is unknown. Keep this flow open.`)}
409
+ />
410
+ ```
411
+
412
+ The host owns its router. Disabling the SDK back button alone cannot block an external route change. If checkout is unexpectedly removed after sending, the SDK still reports a known completion or uncertainty once for that operation. It does not start a new Stripe action after removal, and it never automatically retries a bid. Keep callback state above checkout. Full page reload, browser shutdown, or process termination cannot guarantee callback delivery.
413
+
414
+ If the host combines the lock with recovery and uncertainty flags, update those flags synchronously in a ref before computing the combined lock. Completion can clear recovery and then release the lock in the same turn.
415
+
416
+ ### Simulated review
417
+
418
+ The [State Lab](https://sdk.lockerverse.com/examples/state-lab) includes **Auction** previews for a live bid, an unknown bid result, and purchase recovery. It uses the actual SDK components with a local synthetic transport and Stripe adapter. No API or Stripe network calls are made. The response control pauses a request for inspection; the unexpected-removal control deliberately bypasses navigation only inside this labelled simulation. A preflight pause verifies that removal before sending creates no bid. Simulation reset discards synthetic state only.
419
+
420
+ ## Completion and recovery
421
+
422
+ `onBidSubmitted` means the bid request was submitted. It does not mean the bidder won or a payment was made. If a bid result is unknown, keep the uncertainty visible and do not retry the bid automatically: the bid API has no deduplication key.
423
+
424
+ `onPurchaseComplete` runs only when Lockerverse reports `paid`. Pending payments remain in checkout, with a status action that does not create another payment. The core equivalent is:
425
+
426
+ ```ts
427
+ const purchase = await client.getPurchaseStatus(auctionSlug, itemId, clientRequestId);
428
+ ```
429
+
430
+ A `null` result means no matching purchase is currently recorded. It does not prove an earlier request has stopped. Retry only the original purchase details with the same `clientRequestId`.
431
+
432
+ Keep `onPurchaseRecoveryChange` records private. They contain customer data and a Stripe token, plus the original payment account, item, and amounts. A host can retain the record and pass it as `resumePurchase` when remounting the same item and environment. Remove `resumePurchase` when the callback returns `null`; remount before starting a new purchase after a resolved recovery. The SDK does not store these records in browser storage automatically.
433
+
434
+ `getPurchaseReceipt` returns receipt amounts. Use `getPurchaseStatus` to establish whether payment succeeded.
435
+
436
+ ## Release order
437
+
438
+ Deploy auction payment configuration and the purchase-status endpoint before publishing this SDK version. Older auction responses can still be browsed; the default checkout requires the new payment configuration.
439
+
440
+ ## Availability while a page stays open
441
+
442
+ Cards, filters, counts and item controls update at the auction’s known start/end
443
+ boundaries, using one shared timer and a check when the tab becomes visible.
444
+ There is no network polling for these clock changes. Server draft and finished
445
+ states remain authoritative. Time changes never discard an active checkout or
446
+ purchase recovery. Buy-now cards say Preview item before opening, Buy now while
447
+ available, and View item after closing.
448
+
449
+ ## Motion in embedded views
450
+
451
+ Automatic card rotation and gallery autoplay pause when the component is outside
452
+ the viewport, hidden by its host, or in a background tab. Existing user pause,
453
+ reduced-motion, hover, focus and drag behavior still applies. Manual image
454
+ navigation remains available. A hidden mounted gallery retains its selected image.
455
+
456
+ The State Lab also includes loading, failed loading, upcoming, live, closed,
457
+ sold-out and timed start/end examples. Switch among a single auction, standalone
458
+ card and community browser, open item details, or hide the preview. Its labelled
459
+ images are local simulation data; the preview sends no auction or Stripe requests.
460
+
461
+ Auction descriptions render backend-provided rich HTML through React `dangerouslySetInnerHTML`. The SDK does not sanitize this HTML. Supply trusted or upstream-sanitized descriptions. Plain descriptions retain escaped text and line breaks.
462
+
463
+ ### Direct result review
464
+
465
+ The [auction review page](https://sdk.lockerverse.com/examples/auction-review) can show submitted bids, paid purchases, and unconfirmed receipts without completing checkout. All outcomes are local sample data, rendered by the actual result component. Use Standard SDK to check the default theme or Website style to check the approved host decoration. The photo backdrop, glass badge, and receipt finish belong to the example wrapper, not the SDK defaults. Resize the browser to check mobile layouts.
466
+
467
+ ### External host navigation
468
+
469
+ Use `getAuctionHref` and `getItemHref` for native links, or connect the same URLs to the host’s existing router. Give `LockerverseAuctionItem` a `returnToItemHref` so a completed result can open the original item again. Its `backHref` must point to the auction even after direct item entry. An optional `onBack` can handle ordinary clicks before checkout completes. Do not use history Back as the only return action.
470
+
471
+ The [complete external example](https://sdk.lockerverse.com/examples/auctions) retains the mounted item through refresh, errors, and removal from fresh data. Errors and retry stay beside that item. Its pending-only link guard, unload warning, and cancelable Navigation API guard are best effort; forced navigation or browser shutdown can still discard in-memory recovery. The example uses production; use [local result review](https://sdk.lockerverse.com/examples/auction-review) and [State Lab](https://sdk.lockerverse.com/examples/state-lab) for safe completion checks.
472
+
473
+
474
+ ## Saved auction host integration
475
+
476
+ Keep the existing framework, router, page structure, and surrounding design.
477
+ Mount one integration for the configured auction. Load it directly with
478
+ `useLockerverseAuction` or `client.load(auctionPath)`; never load the community
479
+ list and filter it. Keep live item settings authoritative. Preserve draft,
480
+ closed, sold-out, shipping, and service-fee behavior. Use the built-in styled
481
+ catalog, gallery, checkout, and results. Use supported theme props and tokens;
482
+ use headless only when explicitly requested. Do not add a second checkout,
483
+ iframe, unrelated Stripe account, or external-site redirect.
484
+
485
+ Use item slug/path, with stable item ID as fallback, for encoded host URLs.
486
+ Never use item names or list positions. Keep the saved auction identity fixed;
487
+ route parameters must not select another auction or community. The URL is the
488
+ item-selection source. Support direct entry, reload, sharing, Back/Forward,
489
+ and unknown-item handling. Preserve unrelated host query parameters. Supply
490
+ `getItemHref`, `backHref`, and `returnToItemHref`, and connect ordinary clicks
491
+ to the existing router as needed. Do not use history Back as the only return
492
+ control or silently select the first item for an unknown URL.
493
+
494
+ Keep checkout in a stable mounted route boundary. Pending state includes the
495
+ SDK interaction lock, unresolved purchase recovery, and an uncertain bid.
496
+ Connect it to existing router blockers for item links, site navigation, and
497
+ Back/Forward. Use a pending-only `beforeunload` warning as a best effort, never
498
+ as a promise of durable recovery. Keep normal navigation when not pending.
499
+ Show refresh errors and retry beside the mounted item. Do not replace checkout
500
+ with a loading/error/not-found branch or add a normal manual refresh button.
501
+ Pass fresh same-auction data with the last valid snapshot as fallback.
502
+
503
+ Keep auction recovery private and in memory by default. It contains contact
504
+ data and a Stripe token. Do not log or persist it as part of a new integration.
505
+ If an existing host already restores recovery, read browser storage in an
506
+ effect, never in server rendering. Render public item content initially inert
507
+ until that read completes. Remount once with `resumePurchase` only for a valid
508
+ record matching the auction, item, client, and environment. Live recovery
509
+ callbacks must not change the item key or remount checkout. When the callback
510
+ returns `null`, clear the stored record and resume prop while keeping the key
511
+ stable. Never serialize recovery into loader data, URLs, or metadata.
512
+
513
+ ### TanStack Start server routes
514
+
515
+ On an existing TanStack Start SSR site, put the public SDK load in a GET server
516
+ function and call it from each file-route loader. A shared loader also runs
517
+ on client navigation, so do not treat the loader itself as server-only code.
518
+
519
+ ```tsx
520
+ import { createServerFn } from "@tanstack/react-start";
521
+ import { createLockerverseAuctionClient } from "@lockerverse/sdk/auctions";
522
+
523
+ const auctionOptions = { communitySlug: "your-community" };
524
+ const auctionPath = "your-auction";
525
+ export const getSavedAuction = createServerFn({ method: "GET" }).handler(
526
+ () => createLockerverseAuctionClient(auctionOptions).load(auctionPath)
527
+ );
528
+ // File route: loader: () => getSavedAuction()
529
+ // const initialAuction = Route.useLoaderData();
530
+ // const resource = useLockerverseAuction(auctionOptions, auctionPath, { initialAuction });
531
+ ```
532
+
533
+ Resolve the item from the same route's params and loader data. Set head title
534
+ from the item and auction names, description from that item's description or
535
+ an item-specific fallback, and `og:image` from its image when present. Render
536
+ `resource.auction ?? initialAuction` outside `ClientOnly`; gallery, text, and
537
+ status must be in the first response. Stripe initialization stays in the
538
+ browser. Include public read data only in loader results.
539
+
540
+ For static Vite sites, preserve client loading and report that current
541
+ item-specific first-response metadata needs an SSR response or another static
542
+ build. Do not add a per-site server solely for this integration. For SSR,
543
+ verify raw first-response names and metadata, hydration, direct entry, routing,
544
+ and live refresh. Check desktop and 390 by 844 layouts, unavailable states,
545
+ quantity and bid validation, gallery, and both result return controls. Use the
546
+ SDK simulated result preview. Open checkout to inspect saved fees and shipping,
547
+ but do not submit a live bid or payment.