shop-client 3.12.0 → 3.13.0

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,4 +1,4 @@
1
- # Shop Search
1
+ # Shop Client
2
2
 
3
3
  [![npm version](https://badge.fury.io/js/shop-client.svg)](https://badge.fury.io/js/shop-client)
4
4
  [![TypeScript](https://img.shields.io/badge/TypeScript-Ready-blue.svg)](https://www.typescriptlang.org/)
@@ -205,17 +205,8 @@ Notes:
205
205
 
206
206
  ### Migration: Barrel → Subpath Imports
207
207
 
208
- #### Package Rename: `shop-search` → `shop-client` (v3.8.2)
209
- - Install: `npm i shop-client` (replaces `shop-search`)
210
- - Update imports to `shop-client` (API unchanged)
211
-
212
208
  TypeScript:
213
209
  ```ts
214
- // Before (pre-rename: shop-search)
215
- import { Store } from 'shop-search';
216
- const store = new Store("your-store.myshopify.com");
217
-
218
- // After (post-rename: shop-client v3.8.2+)
219
210
  import { ShopClient } from 'shop-client';
220
211
  const client = new ShopClient("your-store.myshopify.com");
221
212
  ```
@@ -354,6 +345,8 @@ const storeInfo = await shop.getInfo();
354
345
  - `headerLinks`: Navigation menu links
355
346
  - `showcase`: Featured products and collections
356
347
  - `jsonLdData`: Structured data from the store
348
+ - `country`: ISO 3166-1 alpha-2 code (e.g., `US`, `GB`)
349
+ - `currency`: ISO 4217 currency code (e.g., `USD`, `EUR`)
357
350
 
358
351
  ### Products
359
352
 
@@ -444,6 +437,43 @@ Object.entries(filters || {}).forEach(([optionName, values]) => {
444
437
  - Handles products with multiple variant options
445
438
  - Returns empty object `{}` if no products have variants
446
439
 
440
+ ### Predictive Search
441
+
442
+ #### `products.predictiveSearch(query, options?)`
443
+
444
+ Locale-aware Shopify Ajax predictive search for products.
445
+
446
+ ```typescript
447
+ const results = await shop.products.predictiveSearch("dress", {
448
+ limit: 10, // clamps 1–10
449
+ locale: "en", // defaults to "en"
450
+ // unavailableProducts defaults to "hide"
451
+ currency: "USD", // optional override
452
+ });
453
+ ```
454
+
455
+ - Hides unavailable items by default
456
+ - Extracts handles from Ajax results, fetches full products via `find`
457
+ - Falls back to non-locale path when locale returns 404/417
458
+
459
+ ### Recommendations
460
+
461
+ #### `products.recommendations(productId, options?)`
462
+
463
+ Shopify Ajax product recommendations for a given product.
464
+
465
+ ```typescript
466
+ const recos = await shop.products.recommendations(1234567890, {
467
+ limit: 6, // clamps 1–10 (default 10)
468
+ intent: "related", // or "complementary" (default: related)
469
+ locale: "en", // defaults to "en"
470
+ currency: "USD", // optional override
471
+ });
472
+ ```
473
+
474
+ - Returns normalized `Product[]`
475
+ - Locale-aware endpoint `/{locale}/recommendations/products.json`
476
+
447
477
  ### Collections
448
478
 
449
479
  #### `collections.all()`
@@ -219,6 +219,7 @@ function createStoreOperations(context) {
219
219
  * - `jsonLdData` - Structured data from JSON-LD scripts
220
220
  * - `techProvider` - Shopify-specific information (walletId, subDomain)
221
221
  * - `country` - Country detection results with ISO 3166-1 alpha-2 codes (e.g., "US", "GB")
222
+ * - `currency` - ISO 4217 currency code inferred from store (e.g., "USD")
222
223
  *
223
224
  * @throws {Error} When the store URL is unreachable or returns an error
224
225
  *
package/dist/index.mjs CHANGED
@@ -10,7 +10,7 @@ import {
10
10
  import {
11
11
  createStoreOperations,
12
12
  getInfoForStore
13
- } from "./chunk-VK5666EK.mjs";
13
+ } from "./chunk-CUL7ZM2W.mjs";
14
14
  import {
15
15
  classifyProduct,
16
16
  determineStoreType,
package/dist/store.mjs CHANGED
@@ -1,6 +1,6 @@
1
1
  import {
2
2
  createStoreOperations
3
- } from "./chunk-VK5666EK.mjs";
3
+ } from "./chunk-CUL7ZM2W.mjs";
4
4
  import "./chunk-D5MTUWFO.mjs";
5
5
  import "./chunk-G7OCMGA6.mjs";
6
6
  import "./chunk-U3RQRBXZ.mjs";
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "shop-client",
3
- "version": "3.12.0",
3
+ "version": "3.13.0",
4
4
  "type": "module",
5
5
  "main": "./dist/index.mjs",
6
6
  "module": "./dist/index.mjs",