@protonagency/sdk) is an ES module SDK for Shopify storefronts with Layers API integration. It provides reactive state management, built-in caching, and optional Shopify Storefront API enrichment for building rich commerce experiences.
Key Features
Layers API Integration
Full access to Layers’ search, browse, similar products, blocks, and image search APIs with built-in error handling.
Reactive State Management
Built-in Preact Signals integration for reactive UI updates with automatic caching and request deduplication.
Shopify Enrichment
Optional Storefront API integration for richer product data including metafields, full variant info, and collection metadata.
Extensibility
Transform products, collections, and search results with custom extenders. Map filter keys for URL-friendly parameters.
Quick Start
SDK Methods
The SDK provides controllers for all Layers storefront APIs:| Method | Description |
|---|---|
sdk.collection() | Browse and filter products within merchandised collections |
sdk.search() | Full-text semantic search with prepare/execute flow |
sdk.autocomplete() | Predictive search with debouncing and local caching |
sdk.blocks() | Product recommendations powered by Layers blocks |
sdk.uploadImage() | Upload images for image-based search |
sdk.imageSearch() | Search products using uploaded images |
sdk.storefront() | Fetch products by GID with optional collection/page metadata |