Overview
v2 is a ground-up redesign of the SDK. The Shopify Storefront API dependency has been removed, all controllers now expose reactive signals with built-insubscribe(), and the public API surface has been renamed and simplified.
This guide covers every breaking change and provides before/after code snippets to help you migrate.
Install
Initialization
The factory function and its configuration object have been renamed.Config property renames
| v1 | v2 | Notes |
|---|---|---|
createSdk() | createClient() | Factory function |
currencyCode | currency | |
cacheMaxEntries | cacheLimit | |
cacheTtl | cacheLifetime | |
storageAdapter | storage | |
extendProduct | transforms.product | Moved into transforms object |
transformFilters | transforms.filters | Moved into transforms object |
extendCollection | transforms.collection | Moved into transforms object |
extendSearch | transforms.search | Moved into transforms object |
extendBlock | transforms.block | Moved into transforms object |
filterMap | filterAliases | |
restoreFromStorage | restoreCache |
Removed config options
These options no longer exist in v2 since the Storefront API has been removed:enableStorefrontstorefrontApiVersionproductMetafields/variantMetafields/collectionMetafields/pageMetafieldsoptionscacheMaxProducts
Storefront API removal
v2 builds products entirely from Layers API data. The Storefront API integration has been removed. What this means:- Remove any
@shopify/storefront-api-clientdependency - The
storefront()method no longer exists on the client - Collection metadata (title, description, image) is now fetched via
includeMeta: trueoncollection.execute()rather than from the Storefront API - Product metafields are available through the
metafieldsproperty on theProducttype, sourced from Layers
Controllers
All controllers now have subscribe()
Every controller in v2 exposes a subscribe() method for reacting to state changes without importing signal primitives.
Collection
| v1 | v2 |
|---|---|
sortOrderCode | sort |
dynamicLinking | linking |
transformBody | transformRequest |
params / paramDefinitions | Removed — use transformRequest |
Search
Search now accepts initial options at creation time and merges parameters acrossexecute() calls.
| v1 | v2 |
|---|---|
sdk.search() (no args) | client.search(options?) accepts initial options |
dynamicLinking | linking |
transformBody | transformRequest |
tuning uses LayersTuning | tuning uses SearchTuning |
| N/A | temporary flag for one-shot overrides |
Autocomplete renamed to suggest
| v1 | v2 |
|---|---|
sdk.autocomplete() | client.suggest() |
debounceMs | debounce |
PredictiveSearchResponse | Suggestions |
| No subscribe | suggest.subscribe() |
| N/A | excludeInputQuery, excludeQueries options |
Blocks
| v1 | v2 |
|---|---|
anchorId / anchorHandle | anchor (single unified field) |
discountEntitlements | discounts |
dynamicLinking | linking |
Image search
| v1 | v2 |
|---|---|
sdk.imageSearch() | client.searchByImage() |
| Returns raw signal | Returns controller with state, subscribe(), dispose() |
Product type changes
v2 introduces a simplifiedProduct type built entirely from Layers data.
Key differences
- Shallow by default: Products include only the matched variant in
variants. Enable full variants withflags: { variants: true }increateClient. selectedOptionsis now on the product itself (the matched variant’s options)breakoutOptionsreplaces the previous breakout variant handlingoptionsare nowRichProductOption[]withcodeand optionalswatchcategoryfield added with taxonomy datametafieldsis a nestedRecord<string, Record<string, unknown>>(namespace/key structure)combinedListingParentProductIdandcombinedListingRoleadded for combined listings
Removed product fields
These fields from the Storefront API are no longer present:descriptionHtmlonlineStoreUrlseopublishedAtcollections(useincludeMetaon collection queries instead)
Error handling
Error types have been renamed and restructured.| v1 | v2 |
|---|---|
SdkError | ClientError |
| No retry classification | isRetryable() predicate |
| No retry delay info | retryAfterMs on error |
Cache and store
Thestore module has been replaced with a flat cache API.
New in v2
These features are only available in v2:searchContentcontroller for searching articles and blog contentcreateProductCardreactive controller for building product cards with variant selection, option availability, and pricing signalssubscribe()on all controllers for framework-agnostic reactivity- Request deduplication via the built-in
RequestCoordinator temporaryflag on search for one-shot query overrides that don’t persistprepare()on search for warming the API with asearchIdbefore executing- Shallow products for significantly smaller payloads on listing pages
Type renames
| v1 | v2 |
|---|---|
Sdk | Client |
SdkConfig | ClientConfig |
SdkError | ClientError |
CreateSdkResult | CreateClientResult |
FilterMap | FilterAliases |
FilterMapEntry | FilterAlias |
FilterTransformer | transforms.filters |
CollectionExtender | transforms.collection |
SearchExtender | transforms.search |
BlocksExtender | transforms.block |
CollectionExecuteQuery | CollectionQuery |
BlocksExecuteQuery | BlocksQuery |
AutocompleteOptions | SuggestOptions |
AutocompleteController | SuggestController |
PredictiveSearchResponse | Suggestions |
PrepareSearchResult | SearchPrepareResult |
LayersTuning | SearchTuning |
BaseResult | QueryResult |