What problem does it solve?
This Skill provides a practical, implementation-focused guide to connect a custom frontend to Shopify's Storefront GraphQL API so teams can query products, manage carts, and redirect buyers to checkout without exposing sensitive Admin credentials.
Core Features & Use Cases
- Storefront client setup: explains how to create Storefront Access Tokens and configure public (browser) and private (server) clients using the @shopify/storefront-api-client factory.
- Product and collection queries: demonstrates cursor-based pagination, product and variant fields (including availability and pricing), and best practices for fragment reuse and caching.
- Cart management and checkout: shows cart creation, adding lines, persisting cart IDs across sessions, handling userErrors from mutations, and redirecting to Shopify checkout reliably across browsers.
- Use Cases: building Next.js or Hydrogen headless storefronts, embedding Shopify buy widgets, or powering mobile apps requiring localized prices and efficient product pagination.
Quick Start
Create a Storefront Access Token in Shopify Admin, set the appropriate NEXT_PUBLIC_ and server environment variables, and instantiate the storefront client with createStorefrontApiClient to start querying products and managing carts.