Available Packages
The API clients ecosystem consists of the following packages:Admin API Client
Client for Shopify’s Admin API with GraphQL and REST support
Storefront API Client
Client for Shopify’s Storefront API with streaming support
GraphQL Client
Generic GraphQL client for any Shopify GraphQL API
API Codegen Preset
TypeScript type generation for GraphQL operations
Architecture
The API clients follow a layered architecture:- GraphQL Client: Core client handling GraphQL requests, retries, and streaming
- Admin/Storefront Clients: Domain-specific clients with API versioning, authentication headers, and URL formatting
- API Codegen Preset: Development tool for generating TypeScript types from your GraphQL operations
Key Features
Type Safety
All clients support TypeScript and can be enhanced with auto-generated types using the API Codegen Preset:Automatic Retries
Built-in retry logic for failed requests with configurable retry counts:Flexible Authentication
Support for different authentication methods depending on the API:- Admin API: Access tokens via
X-Shopify-Access-Tokenheader - Storefront API: Public or private access tokens
- Custom: Provide your own headers for any API
Stream Support
Storefront and GraphQL clients support streaming responses for operations using the@defer directive:
Custom Fetch API
All clients support custom fetch implementations for Node.js or custom networking:Installation
Install the package you need using your preferred package manager:Quick Start
- Admin API
- Storefront API
Common Patterns
Error Handling
All clients return a consistent error structure:API Versioning
You can override the API version per request:Logging
All clients support custom loggers for debugging:Next Steps
Admin API Client
Learn about GraphQL and REST endpoints for the Admin API
Storefront API Client
Build customer-facing storefronts with the Storefront API
Type Generation
Auto-generate TypeScript types for your operations
GraphQL Client
Use the low-level GraphQL client for custom APIs