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.
npm install shopify-api-nodeVerified import paths — ran on the pinned version, not inferred.
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.
Ensure you provide either `apiKey` and `password` (for private apps) OR `accessToken` (for public apps), but never both simultaneously.
Set either `autoLimit` to `true` (or an object configuration) or `maxRetries` to a number greater than 0, but do not enable both at the same time.
Include `apiVersion: 'YYYY-MM'` in the `Shopify` constructor options, regularly updating it as Shopify releases new stable API versions.
If precision issues with large IDs occur, provide a custom `parseJson` function that handles big integers, for example, by parsing them as strings or using a `BigInt` polyfill/library.
Provide a `shopName` string in the `Shopify` constructor options, like `new Shopify({ shopName: 'my-shop.myshopify.com', ... })`.Choose one authentication method: either provide `apiKey` and `password` for private apps OR `accessToken` for public/custom apps that use OAuth.
For ESM, use `import Shopify from 'shopify-api-node';`. Ensure your `package.json` specifies `"type": "module"` or files end with `.mjs`.
Enable `autoLimit: true` in your Shopify client options, or configure it with specific `calls`, `interval`, and `bucketSize` settings. Consider using `maxRetries` if `autoLimit` is not desired for proactive limiting.