Agent skill · software engineering · jeremylongshore

shopify-sdk-patterns

Apply production-ready patterns for @shopify/shopify-api including typed

Why this skill is useful

Adds multiple executable patterns and classes for integrating with the Shopify API that are not available in public documentation.

What it needs

Requires @shopify/api-codegen-preset, @shopify/shopify-api installed locally. About 4k tokens when loaded. Last updated 2026-08-07. 2,604 stars on the source repository.

What this skill does

Shopify SDK Patterns Overview Production-ready patterns for the @shopify/shopify-api library: singleton clients, typed GraphQL operations, session management, cursor-based pagination, codegen-typed operations, bulk operations, and webhook registry patterns. Prerequisites @shopify/shopify-api v9+ installed Familiarity with Shopify's GraphQL Admin API Understanding of async/await and TypeScript generics Instructions Step 1: Typed GraphQL Client Wrapper Initialize a singleton shopifyApi instance with LATESTAPIVERSION, cache sessions per shop, and expose a typed shopifyQuery<T>() helper that wraps client.request(). See Typed GraphQL Client for the complete implementation. Step 2: Error Handling with Shopify Error Types Custom ShopifyServiceError class that distinguishes retryable errors (429, 5xx) from permanent ones. Includes handleShopifyError() for error translation and safeShopifyCall() that returns {data, error} tuples instead of throwing. See Error Handling for the complete implementation. Step 3: Cursor-Based Pagination Async generator paginateShopify<T>() for Relay-style cursor pagination. Yields batches of nodes, automatically following pageInfo.endCursor until hasNextPage is false. Memory-efficient for large datasets. See Cursor Pagination for the complete implementation. Step 4: Multi-Tenant Client Factory ShopifyClientFactory class for apps installed on multiple stores. Creates isolated GraphqlClient instances per merchant with session caching. Includes removeClient() for eviction on app uninstall. See Multi-Tenant Factory for the complete implementation. Step 5: Codegen-Typed Operations Use @shopify/api-codegen-preset to generate TypeScript types from your GraphQL operations. This eliminates manual type definitions and catches schema changes at build time. Run npx graphql-codegen after changing any GraphQL operation or upgrading API versions. …

How to use it

Reference it in AdaL, Claude Code, Cursor or any coding agent — nothing to install:

@skills jeremylongshore/shopify-sdk-patterns--fa503e

View the source on GitHub

Browse the @skills marketplace