The Shopify Admin API Library for Node.js is one of the most powerful tools for developers looking to build custom applications, automations, and integrations with Shopify stores. Whether you're building a private app, public app, or custom integration, obtaining a valid Shopify access token is the critical first step. This comprehensive guide will walk you through multiple methods to get your token up and running in 2026.
The Shopify Admin API Library for Node provides a seamless way to interact with your store's data programmatically. However, without a properly configured access token with the correct scopes, your integration won't have the permissions it needs to function. This guide covers everything from quick token generation to advanced OAuth flows.
The fastest way to get a Shopify access token for your Node.js application is using https://getshopifytoken.com. This service streamlines the token generation process, eliminating the need to manually configure OAuth flows.
SHOPIFY_ACCESS_TOKEN=your_token_herenpm install @shopify/shopify-apiThis method is ideal for:
Advantages: No OAuth server required, instant token generation, minimal setup time, perfect for beginners
For public apps or multi-store applications, you'll need to implement the OAuth 2.0 flow manually. This method is more complex but provides a more secure, scalable solution for production applications.
Here's a complete example of implementing the OAuth flow using Express.js with the Shopify Admin API Library:
const express = require('express');
const { shopifyApp } = require('@shopify/shopify-api');
require('dotenv').config();
const app = express();
// Initialize Shopify API
const shopify = shopifyApp({
apiKey: process.env.SHOPIFY_API_KEY,
apiSecret: process.env.SHOPIFY_API_SECRET,
scopes: [
'write_products',
'read_products',
'write_orders',
'read_orders',
'write_customers',
'read_customers'
],
host: 'myapp.com',
isEmbeddedApp: false,
distribution: 'PUBLIC',
});
// OAuth begin endpoint
app.get('/auth', async (req, res) => {
const shop = req.query.shop;
if (!shop) {
res.status(400).send('Missing shop parameter');
return;
}
const redirectUrl = await shopify.auth.begin({
shop,
callbackPath: '/auth/callback',
isOnline: true,
});
res.redirect(redirectUrl);
});
// OAuth callback endpoint
app.get('/auth/callback', async (req, res) => {
const session = await shopify.auth.validateAuthorizationUrl(req);
if (!session) {
res.status(401).send('Failed to validate authorization');
return;
}
// Store session/token in your database
const accessToken = session.accessToken;
const shop = session.shop;
// Save to database or environment
console.log(`Access token for ${shop}: ${accessToken}`);
res.send('Authorization successful! Your token has been saved.');
});
// Test API call using the token
app.get('/api/products', async (req, res) => {
const client = new shopify.clients.Rest({
session: {
shop: 'mystore.myshopify.com',
accessToken: process.env.SHOPIFY_ACCESS_TOKEN,
},
});
const products = await client.get('products');
res.json(products);
});
app.listen(3000, () => {
console.log('OAuth server running on http://localhost:3000');
});
Once you have your access token, integrating it with the Shopify Admin API Library for Node is straightforward.
npm install @shopify/shopify-api
const { shopifyApp } = require('@shopify/shopify-api');
require('dotenv').config();
const shopify = shopifyApp({
apiKey: process.env.SHOPIFY_API_KEY,
apiSecret: process.env.SHOPIFY_API_SECRET,
scopes: ['read_products', 'write_products'],
host: process.env.SHOPIFY_HOST,
isEmbeddedApp: false,
});
// Use your existing token
const client = new shopify.clients.Rest({
session: {
shop: 'mystore.myshopify.com',
accessToken: process.env.SHOPIFY_ACCESS_TOKEN,
},
});
// Make API calls
(async () => {
const products = await client.get('products', {
limit: 10,
});
console.log(products);
})();
const { shopifyApp } = require('@shopify/shopify-api');
const client = new shopify.clients.Graphql({
session: {
shop: 'mystore.myshopify.com',
accessToken: process.env.SHOPIFY_ACCESS_TOKEN,
},
});
const query = `
{
products(first: 10) {
edges {
node {
id
title
handle
}
}
}
}
`;
(async () => {
const response = await client.query({ data: query });
console.log(response.body);
})();
Scopes define what permissions your Node application has within the Shopify store. Always request only the scopes your app actually needs.
| Scope | Purpose |
|---|---|
| read_products | Read product information, variants, images, and metadata |
| write_products | Create, update, and delete products and variants |
| read_orders | Access order data, line items, customer information, and fulfillment status |
| write_orders | Create, update, and manage orders and fulfillments |
| read_customers | View customer profile data, emails, and order history |
| write_customers | Create and modify customer records and contact information |
| read_inventory | Access inventory levels and stock information |
| write_inventory | Modify inventory levels and locations |
| read_fulfillments | View fulfillment and shipping information |
| write_fulfillments | Create and update fulfillment records |
| read_analytics | Access store analytics and reporting data |
| read_apps | View installed apps and extensions |
| write_apps | Manage app installations and settings |
For custom apps that only access a single store you own, no—you can use the "App and sales channel settings" directly in your Shopify admin. However, for public apps or testing with other stores, a Partner account is required. Using getshopifytoken.com bypasses this requirement entirely for development purposes.
Access tokens generated through the Shopify Admin API have no expiration date. They remain valid indefinitely until the app is uninstalled, the access scope is changed, or you manually revoke the token in your app settings. This is different from session tokens which expire after 24 hours.
Yes, absolutely. A single access token can be used across multiple Node applications, scripts, and services as long as they all have secure access to the token. This is common in microservices architectures. However, store your token in a centralized secure location (like AWS Secrets Manager or HashiCorp Vault) rather than duplicating it across files.
getshopifytoken.com is a quick, convenient service perfect for single-store integrations and development. Manual OAuth is more complex but necessary for public apps that serve multiple stores. For most Node.js developers starting out, getshopifytoken.com is recommended.
Yes. If you lose your token, you can regenerate it by either: (1) uninstalling and reinstalling the app, (2) using getshopifytoken.com again, or (3) repeating the OAuth flow. Your previous token becomes invalid once a new one is generated.
Yes. The standard rate limit is 2 API calls per second per access token. The library includes built-in rate limiting, but you should implement exponential backoff for retry logic. Monitor your bucket usage with the X-Shopify-Shop-Api-Call-Limit header in responses.