@omni-commerce/sdk 0.8.0 → 0.9.2

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
@@ -6,7 +6,13 @@ The client is generated from the public OpenAPI spec so every documented REST en
6
6
 
7
7
  The surface is a resource client with one request object per call, dual ESM/CJS builds, and typed HTTP errors.
8
8
 
9
- Assistant chat is available from `@omni-commerce/sdk/react` (`OmniProvider`, `OmniChat`) and `@omni-commerce/sdk/embed` (`createOmniChatEmbed`, `createOmniChatWidget`). They mount the same hosted chat for public visitors or organization members. Widgets accept `presentation: "sidebar"` for a full-height drawer, or `"floating"` (the default), with `position: "left" | "right"`. Inline and React chat fill their host container. React is an optional peer dependency; REST and plain JavaScript consumers do not need it. See [chat integration](https://docs.omnicommerce.sg/sdk/chat) for multiple assistants and session handling.
9
+ Application chat is available from `@omni-commerce/sdk/react` (`OmniProvider`, `OmniChat`) and `@omni-commerce/sdk/embed` (`createOmniApplicationChatEmbed`). With SDK 0.9.0, render `<OmniProvider><OmniChat /></OmniProvider>` to use the signed-in viewer's organization and assistant. No Storefront deployment is required. Optional `organizationId`, `agentId`, and `appId` select the application scope; authentication stays inside the hosted chat frame.
10
+
11
+ SDK 0.9.1 adds `<OmniProvider><OmniChatLayout>{applicationContent}</OmniChatLayout></OmniProvider>` for a full-height responsive application shell. Chat docks on the right at 960px and above; below 960px it collapses to a launcher that opens a full-height native modal. Opening, closing and resizing preserve one chat iframe. `OmniChat` remains the inline primitive for custom layouts.
12
+
13
+ Storefront chat continues to use `deploymentId` with `createOmniChatEmbed` or `createOmniChatWidget`. Widgets accept `presentation: "sidebar"` for a full-height drawer, or `"floating"` (the default), with `position: "left" | "right"`. On mobile (widths up to 640px, or touch devices with viewport heights up to 480px in landscape), both widget presentations open as full-screen modal chat, adapting to the on-screen keyboard and locking storefront scrolling until closed. Inline and React chat fill their host container. React is an optional peer dependency; REST and plain JavaScript consumers do not need it. See [chat integration](https://docs.omnicommerce.sg/sdk/chat) for multiple assistants and session handling.
14
+
15
+ Set launcher spacing in Storefront → Design, or override individual SDK values with `bottomOffset`, `sideOffset`, `mobileBottomOffset`, and `mobileSideOffset`. Values are whole pixels from 0 to 500, defaulting to 20px. Omitted options inherit saved deployment settings. Device safe areas are added automatically, and spacing and floating panel size adapt to the available viewport.
10
16
 
11
17
  With SDK 0.8.0, pass `application={{ name, description, getContext }}` and `frontendTools` to connect live app state and local UI actions. Tool names use the `app_` namespace and JSON object schemas. Native LangGraph pauses the call, your app executes it, and its result returns to the agent. Host tools confer no extra server permissions. See the [application integration guide](https://docs.omnicommerce.sg/sdk/chat#application-context-and-ui-actions) for a complete React example.
12
18
 
@@ -69,6 +75,23 @@ await client.orders.get(
69
75
 
70
76
  `await request.withRawResponse()` returns `{ data, rawResponse }` with status and headers.
71
77
 
78
+ ## Batch market price comparison
79
+
80
+ SDK 0.9.2 adds `products.comparePrices` and `products.getPriceComparison`. Submit up to 50 simple product or variant IDs with a `catalog:read` credential:
81
+
82
+ ```ts
83
+ const queued = await client.products.comparePrices({
84
+ productIds: ["cc87d195-097a-4a5a-8229-cd989ce98d0f"],
85
+ });
86
+ await client.jobs.wait({ jobId: queued.jobId }, { timeoutInSeconds: 1800 });
87
+ const completed = await client.products.getPriceComparison({
88
+ jobId: queued.jobId,
89
+ });
90
+ console.log(completed.result?.success, completed.result?.results);
91
+ ```
92
+
93
+ Omit `gl` to compare all recorded listing markets; `gl: "sg"` restricts research to Singapore. Global Zalora prices stay separate by country/currency. An India Shopify store selling in SGD is researched in Singapore. Read each product's `markets` array for its price evidence, research, comparison, and errors. Missing published price evidence is an explicit failure; a catalog fallback is never a verified listing price. Client timeouts leave the durable job running. [Full comparison guide](https://docs.omnicommerce.sg/sdk/typescript#market-price-comparison).
94
+
72
95
  ## Resources
73
96
 
74
97
  | Client | Examples |
@@ -127,3 +150,5 @@ yarn sdk:generate
127
150
  ```
128
151
 
129
152
  That refreshes `docs/openapi.json`, the OpenAPI TypeScript types, and `src/generated/resources.ts`.
153
+
154
+ With SDK 0.8.1, website widgets load saved Storefront appearance by deployment ID. Install the generated deployment-only snippet once; saving an agent or design change updates the next website load. Explicit appearance options override saved values. The `ready` promise resolves after configuration loads, or rejects on an error reported to `onError`.