Registry / communication / shopify-node-api

shopify-node-api

JSON →
library1.11.1jsnpmunverified

Node.js module for Shopify API OAuth2 authentication and REST requests. Version 1.11.1 provides support for public and private Shopify apps, handling OAuth token exchange, signature verification, and CRUD operations. It is an older, unmaintained library with minimal updates since 2016. Compared to alternatives like shopify-api-node or @shopify/shopify-api, it lacks TypeScript support, modern API features, and active maintenance.

npm install shopify-node-api
INSTALL
IMPORT
SIG · SHOPIFY-NODE-API
S
shopify-node-api
communicationjavascriptv1.11.1
Install
Import
Disk
Pass rate
0/ 6
Env Coverage0 / 6
glibc
1822
musl
1822
Install & Compatibility
Where this runs
tested against v? · npm install
Install × environment matrix
Each cell = how many times install + import succeeded across repeated harness runs. Partial = flaky.
glibc = Debian/Ubuntu slim · musl = Alpine Linux
musl
node 18226 runs
build_error
glibc
node 18226 runs
build_error
Code
Verified usage

Verified import paths — ran on the pinned version, not inferred.

shopifyAPI
const shopifyAPI = require('shopify-node-api');
import shopifyAPI from 'shopify-node-api';
This package is CJS-only; does not support ESM imports.
Shopify instance
const Shopify = new shopifyAPI({ shop: '...', shopify_api_key: '...' });
const Shopify = shopifyAPI({ shop: '...' });
Must use 'new' keyword when instantiating; omitting it may cause silent failures.
buildAuthURL
Shopify.buildAuthURL();
shopifyAPI.buildAuthURL();
buildAuthURL is an instance method, not a static method.

Shows OAuth flow: initialize, build auth URL, exchange token for permanent access.

const shopifyAPI = require('shopify-node-api'); const Shopify = new shopifyAPI({ shop: 'my-shop', shopify_api_key: process.env.SHOPIFY_API_KEY ?? '', shopify_shared_secret: process.env.SHOPIFY_SECRET ?? '', shopify_scope: 'write_products', redirect_uri: 'http://localhost:3000/finish_auth', nonce: 'random-nonce' }); // Build authorization URL const authUrl = Shopify.buildAuthURL(); console.log('Authorize at:', authUrl); // After Shopify redirects back, exchange temporary token app.get('/finish_auth', (req, res) => { Shopify.exchange_temporary_token(req.query, (err, data) => { if (err) return res.status(500).send(err.message); // access_token available in data.access_token res.send('Authenticated!'); }); });
Debug
Known issues
breakingConstructor throws error if no config object passed
fix
Always pass a valid config object: 'new shopifyAPI({...})'
affects: >=1.0.0
gotchaAccess token in config is not updated automatically after exchange_temporary_token
fix
Manually set 'config.access_token = data.access_token' after callback
affects: >=1.0.0
deprecatedOAuth signature verification uses outdated HMAC-SHA256
fix
Use '@shopify/shopify-api' instead for up-to-date security
affects: >=1.0.0
gotchaNonce is required but not validated; must be unique per request
fix
Generate a cryptographically random nonce for each auth request
affects: >=1.0.0
gotchaHTTP request errors may not propagate correctly
fix
Always check 'err' parameter in callbacks; wrap in try-catch
affects: >=1.0.0
Errors
Common errors & fixes
Error: ShopifyAPI module expects a config object
Instantiating without a config object
fix
const Shopify = new shopifyAPI({ shop: '...', shopify_api_key: '...' });
Cannot read property 'get' of undefined
Calling methods on undefined instance if 'new' keyword omitted
fix
Use 'new shopifyAPI()' instead of 'shopifyAPI()'
Upgrade
Version history
1.11.1latest on npm
Audit
Dependencies

No dependency data recorded yet.

Agent activity
18 hits · last 30 days
node
17
OpenAI (training)
1
Resources
shopify-node-api — npm install shopify-node-api · libregistry