SPB Git

spb/rareindex

Public
921 B · 18 lines typescript
1import { ShopifyStoreConnector, type ConnectorMeta } from '@rareindex/connectors';23/**4 * ShopifyStoreConnector pinned to the shop's home market.5 *6 * Shopify Markets localises `products.json` prices by the requester's IP as soon as the request carries an7 * Accept-Language header: a Canadian crawler reading a US shop gets CAD-converted prices while the JSON has no8 * currency field — the listing would be silently mislabelled as USD (§192). The market pin (public9 * `localization=<CC>` cookie) now lives in the SDK adapter itself (`config.market`, default `meta.regions[0]`);10 * this subclass only enforces that a market is known for the g3 fleet.11 */12export class MarketPinnedShopifyConnector extends ShopifyStoreConnector {13  constructor(meta: ConnectorMeta) {14    super(meta);15    if (!this.market) throw new Error(`${meta.id}: config.market (or regions[0]) must be an ISO-3166 alpha-2 country code`);16  }17}18
Files · b5d6968a47f5d2546937866bdabc967739349047
Menu

Theme