Module Config
The Nuxt Shopify module can be configured via the shopify property in your nuxt.config.ts file.
Environment variables
Any option can be supplied through the environment instead of being written into nuxt.config.ts, which is
how you keep tokens out of the repository. Nuxt only maps an environment variable onto a config key that
already exists, so declare the key under runtimeConfig.shopify first:
export default defineNuxtConfig({
modules: ["@nuxtjs/shopify"],
shopify: {
name: "nuxt-module-store",
clients: {
storefront: {
apiVersion: "...",
publicAccessToken: "...",
},
},
},
})
export default defineNuxtConfig({
modules: ["@nuxtjs/shopify"],
runtimeConfig: {
shopify: {
name: "nuxt-module-store",
clients: {
storefront: {
apiVersion: "2026-04",
publicAccessToken: "...",
},
},
},
public: {
shopify: {
clients: {
storefront: {
// Override the public storefront token
publicAccessToken: "...",
},
},
},
},
},
})
NUXT_SHOPIFY_NAME="nuxt-module-store"
NUXT_SHOPIFY_CLIENTS_STOREFRONT_API_VERSION="2026-04"
NUXT_SHOPIFY_CLIENTS_STOREFRONT_PUBLIC_ACCESS_TOKEN="..."
Precedence, highest first: runtimeConfig.public.shopify, then runtimeConfig.shopify, then the shopify
block in nuxt.config.ts.
Resolved config
The module parses and resolves your configuration on startup and writes the result back to the runtime
config. You can read it from _shopify, the shopify object contains the raw config input.
useRuntimeConfig()._shopify: Full resolved config on the server, typed asShopifyConfig. It carries credentials, so it must never reach the browser.useRuntimeConfig().public._shopify: Filtered copy that is safe in the browser, typed asPublicShopifyConfig.useRuntimeConfig().shopify: Raw config input, unresolved.
Quickstart
Minimal configuration to get started:
export default defineNuxtConfig({
modules: ["@nuxtjs/shopify"],
shopify: {
name: "nuxt-module-store",
clients: {
storefront: {
apiVersion: "2026-04",
publicAccessToken: "...",
},
customerAccount: {
apiVersion: "2026-04",
clientId: "...",
},
admin: {
apiVersion: "2026-04",
clientId: "...",
clientSecret: "...",
},
},
},
})
Configuration Examples
Choose the configuration that matches your use case:
export default defineNuxtConfig({
shopify: {
name: "nuxt-module-store",
clients: {
storefront: {
apiVersion: "2026-04",
publicAccessToken: "...",
},
},
},
})
export default defineNuxtConfig({
shopify: {
name: "nuxt-module-store",
clients: {
storefront: {
apiVersion: "2026-04",
privateAccessToken: "...",
},
},
},
})
export default defineNuxtConfig({
shopify: {
name: "my-mocked-shopify-store",
clients: {
storefront: {
apiVersion: "2026-04",
mock: true,
},
},
},
})
export default defineNuxtConfig({
shopify: {
name: "nuxt-module-store",
clients: {
customerAccount: {
apiVersion: "2026-04",
clientId: "...",
},
},
},
})
export default defineNuxtConfig({
shopify: {
name: "nuxt-module-store",
clients: {
admin: {
apiVersion: "2026-04",
clientId: "...",
clientSecret: "...",
// accessToken is optional if using clientId and clientSecret
accessToken: "...",
},
},
},
})
Full Configuration Reference
Basic Options
nuxt-module-store).Client Configuration
Configure one or more API clients:
API versions
Shopify ships a new API version every quarter and supports each one for at least a year. Every client takes an
apiVersion, and leaving it unset means the module picks whichever version is current at build time, so an
unchanged codebase can move to a new API version when being rebuilt in a new quarter. Pin apiVersion per client
if you want that upgrade to be a deliberate change:
export default defineNuxtConfig({
shopify: {
name: 'nuxt-module-store',
clients: {
storefront: {
apiVersion: '2026-04',
publicAccessToken: '...',
},
},
},
})
Storefront Client
2026-04) - default: the current stable API versionfalsetrue for the default route or provide { route } - default: truetruefalse to disable it - default: truetruelru-cache drivershort, long) - default: short (10 second TTL) and long (1 day TTL)0 and 3 - default: 0Customer Account Client
2026-04) - default: the current stable API version['openid', 'email', 'customer-account-api:full']/_auth/customer-account/callback/_auth/customer-account/logout/_auth/customer-account/sessionredirect_uri, which is
routes.callback - default: /afterLoginshopify-customer-account604800 (7 days)httpOnly is always enforced/SameSite attribute of the session cookie - default: lax. Setting none allows other sites to send authenticated requests
to the customer account proxy, so only use it if you need cross-site embeddingSecure attribute of the session cookie - default: true outside of developmenttrue for the in-memory driver (single-instance only) - default: false (client-side cookie fallback)/_auth/customer-account/bridgetrue for the default route or provide { route } - default: truetruefalse to disable it - default: truefalse0 and 3 - default: 0Admin Client
2026-04) - default: the current stable API versiontruefalse to disable it - default: truefalse0 and 3 - default: 0Fragments
['graphql']trueGraphQL
graphql.config.mjs for IDE features like autocompletion and validation -
default: truetruetrueError Handling
errors object in the response - default: trueWebhooks
Analytics
Set analytics to true to enable Shopify analytics with the defaults, or to an object to
configure it. All options are optional - default: false
<name>.myshopify.comgid://shopify/Shop/<id>. Resolved from the Storefront API when omittedUSD). Resolved from the Storefront API when omittedEN). Resolved from the Storefront API when omittedpage_viewed event on the initial load and on every client-side navigation - default: truepublicAccessTokenbanner.country and banner.language - default: falseComplete Example
Full configuration example with all options:
export default defineNuxtConfig({
modules: ["@nuxtjs/shopify"],
shopify: {
name: "nuxt-module-store",
clients: {
storefront: {
apiVersion: "2026-04",
publicAccessToken: "...",
privateAccessToken: "...",
mock: false,
proxy: {
route: "/_proxy/storefront",
},
explorer: true,
codegen: {
plugins: {
typescript: {},
},
},
cache: {
client: {
ttl: 1000 * 10,
},
proxy: {
driver: "lru-cache",
},
presets: {
short: { maxAge: 1, staleMaxAge: 9, swr: true },
long: { maxAge: 3600, staleMaxAge: 82800, swr: true },
},
},
headers: {},
retries: 0,
},
customerAccount: {
apiVersion: "2026-04",
clientId: "...",
clientSecret: "...",
apiURL: "https://shopify.com/.../account/customer/api/2026-04/graphql",
scope: ["openid", "email", "customer-account-api:full"],
routes: {
callback: "/_auth/customer-account/callback",
logout: "/_auth/customer-account/logout",
session: "/_auth/customer-account/session",
},
afterLogin: "/",
afterLogout: "/",
session: {
name: "shopify-customer-account",
password: "...",
maxAge: 604800,
cookie: {
path: "/",
sameSite: "lax",
secure: true,
},
},
tokenStorage: false,
dev: {
tunnelURL: "https://your-tunnel-url.ngrok-free.app",
bridgeURL: "http://localhost:3000/_auth/customer-account/bridge",
},
proxy: {
route: "/_proxy/customer-account",
},
explorer: true,
codegen: {
plugins: {
typescript: {},
},
},
headers: {},
retries: 0,
},
admin: {
apiVersion: "2026-04",
clientId: "...",
clientSecret: "...",
accessToken: "...",
refreshToken: "...",
tokenStorage: {
driver: "memory"
},
explorer: true,
codegen: {
plugins: {
typescript: {},
},
},
headers: {},
retries: 0,
},
},
logger: {},
fragments: {
dirs: ["graphql"],
},
graphql: {
generateConfig: true,
injectFragments: true,
normalize: true,
},
errors: {
throw: true,
},
webhooks: {
secret: "...",
hooks: [
{
topic: "ORDERS_CREATE",
uri: "https://your-app.com/api/webhooks/orders-create",
format: "JSON",
filter: "",
includeFields: ["id", "title"],
metafieldNamespaces: [],
metafields: [],
},
],
},
analytics: {
domain: "your-store.com",
shopId: "...",
storefrontId: "...",
language: "EN",
currency: "EUR",
consent: {
checkoutDomain: "checkout.your-store.com",
storefrontAccessToken: "...",
banner: {
country: "DE",
language: "EN",
},
},
},
},
})