shopify-sdk-patterns

Featured

Apply production-ready patterns for @shopify/shopify-api including typed GraphQL clients, session management, and retry logic. Use when implementing Shopify integrations, refactoring SDK usage, or establishing team coding standards for Shopify. Trigger with phrases like "shopify SDK patterns", "shopify best practices", "shopify code patterns", "idiomatic shopify", "shopify client wrapper".

AI & Automation 2,266 stars 315 forks Updated today MIT

Install

View on GitHub

Quality Score: 99/100

Stars 20%
100
Recency 20%
100
Frontmatter 20%
70
Documentation 15%
100
Issue Health 10%
50
License 10%
100
Description 5%
100

Skill Content

# Shopify SDK Patterns ## Overview Production-ready patterns for the `@shopify/shopify-api` library: singleton clients, typed GraphQL operations, session management, cursor-based pagination, and error handling wrappers. ## 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 ```typescript // src/shopify/client.ts import "@shopify/shopify-api/adapters/node"; import { shopifyApi, Session, GraphqlClient } from "@shopify/shopify-api"; const shopify = shopifyApi({ apiKey: process.env.SHOPIFY_API_KEY!, apiSecretKey: process.env.SHOPIFY_API_SECRET!, hostName: process.env.SHOPIFY_HOST_NAME!, apiVersion: "2024-10", isCustomStoreApp: !!process.env.SHOPIFY_ACCESS_TOKEN, adminApiAccessToken: process.env.SHOPIFY_ACCESS_TOKEN, }); // Singleton session cache per shop const sessionCache = new Map<string, Session>(); export function getSession(shop: string): Session { if (!sessionCache.has(shop)) { const session = shopify.session.customAppSession(shop); sessionCache.set(shop, session); } return sessionCache.get(shop)!; } export function getGraphqlClient(shop: string): GraphqlClient { return new shopify.clients.Graphql({ session: getSession(shop), }); } // Typed query helper export async function shopifyQuery<T = any>( shop: string, query: string, variables?: Record<string, unknown> ): ...

Details

Author
jeremylongshore
Repository
jeremylongshore/claude-code-plugins-plus-skills
Created
7 months ago
Last Updated
today
Language
Python
License
MIT

Integrates with

Similar Skills

Semantically similar based on skill content — not just same category

AI & Automation Featured

klaviyo-sdk-patterns

Apply production-ready Klaviyo SDK patterns for the klaviyo-api package. Use when implementing Klaviyo integrations, refactoring SDK usage, or establishing team coding standards for Klaviyo API calls. Trigger with phrases like "klaviyo SDK patterns", "klaviyo best practices", "klaviyo code patterns", "idiomatic klaviyo", "klaviyo wrapper".

2,266 Updated today
jeremylongshore
AI & Automation Featured

shopify-apps

Expert patterns for Shopify app development including Remix/React Router apps, embedded apps with App Bridge, webhook handling, GraphQL Admin API, Polaris components, billing, and app extensions.

39,227 Updated today
sickn33
AI & Automation Featured

hubspot-sdk-patterns

Apply production-ready @hubspot/api-client SDK patterns for TypeScript. Use when implementing HubSpot integrations, building typed wrappers, or establishing team standards for HubSpot CRM operations. Trigger with phrases like "hubspot SDK patterns", "hubspot best practices", "hubspot typed client", "hubspot api-client wrapper", "idiomatic hubspot".

2,266 Updated today
jeremylongshore
AI & Automation Featured

apollo-sdk-patterns

Apply production-ready Apollo.io SDK patterns. Use when implementing Apollo integrations, refactoring API usage, or establishing team coding standards. Trigger with phrases like "apollo sdk patterns", "apollo best practices", "apollo code patterns", "idiomatic apollo", "apollo client wrapper".

2,266 Updated today
jeremylongshore
AI & Automation Featured

apify-sdk-patterns

Production-ready patterns for Apify SDK and apify-client in TypeScript. Use when building Actors with Crawlee, managing datasets/KV stores, or implementing robust client wrappers with retry and validation. Trigger: "apify SDK patterns", "apify best practices", "apify client wrapper", "crawlee patterns", "idiomatic apify".

2,266 Updated today
jeremylongshore