{"library":"shopify-api-node","title":"Shopify API Node.js Client","description":"The `shopify-api-node` package provides robust and well-maintained bindings for interacting with the Shopify REST and GraphQL APIs from Node.js environments. Currently stable at version 3.15.0, the library receives regular updates to maintain compatibility with new Shopify API versions and features, ensuring developers have access to the latest functionalities. Key differentiators include built-in automatic rate limiting (configurable via `autoLimit`) to manage API call quotas, comprehensive proxy support through the `agent` option utilizing `got`, and the flexibility to customize JSON parsing and stringification functions for handling specific data types like long integer IDs. It supports both private app credentials (API key and password) and public app OAuth access tokens, making it versatile for various Shopify application architectures.","language":"javascript","status":"active","last_verified":"Sun Apr 19","install":{"commands":["npm install shopify-api-node"],"cli":null},"imports":["import Shopify from 'shopify-api-node';","import type { Options } from 'shopify-api-node';","import type { ShopifyRestResources } from 'shopify-api-node';"],"auth":{"required":false,"env_vars":[]},"quickstart":{"code":"import Shopify from 'shopify-api-node';\n\nconst shopify = new Shopify({\n  shopName: process.env.SHOPIFY_SHOP_NAME ?? 'my-shop-name',\n  accessToken: process.env.SHOPIFY_ACCESS_TOKEN ?? 'shpca_YOUR_ACCESS_TOKEN',\n  // Alternatively for private apps:\n  // apiKey: process.env.SHOPIFY_API_KEY ?? 'YOUR_API_KEY',\n  // password: process.env.SHOPIFY_PASSWORD ?? 'YOUR_PASSWORD',\n  apiVersion: '2024-04', // Always specify a stable API version\n  autoLimit: true // Enable automatic rate limiting\n});\n\nasync function getProducts() {\n  try {\n    const products = await shopify.product.list({\n      limit: 5,\n      fields: 'id,title,variants'\n    });\n    console.log('Fetched products:', JSON.stringify(products, null, 2));\n    // Example: Fetch a specific product by ID\n    if (products.length > 0) {\n      const firstProductId = products[0].id;\n      const singleProduct = await shopify.product.get(firstProductId);\n      console.log('Fetched single product:', singleProduct.title);\n    }\n  } catch (error) {\n    console.error('Error fetching products:', error);\n    if (error.response && error.response.statusCode) {\n      console.error('Shopify API Error Status:', error.response.statusCode);\n      console.error('Shopify API Error Body:', error.response.body);\n    }\n  }\n}\n\ngetProducts();","lang":"typescript","description":"Initializes the Shopify client, fetches a list of products, and then retrieves a single product by ID, demonstrating basic API interaction with environment variables for credentials.","tag":null,"tag_description":null,"last_tested":null,"results":[]},"compatibility":null}