Getting Started
Project Structure
Typical file structure for a shopify-app-nuxt application.
Overview
A shopify-app-nuxt app is a standard Nuxt application with the shopify-app-nuxt module enabled. The module auto-registers server utilities, client composables, components, OAuth routes, and App Bridge — so your project stays clean.
Typical structure
nuxt.config.ts
export default defineNuxtConfig({
modules: ['shopify-app-nuxt'],
shopify: {
apiKey: process.env.SHOPIFY_API_KEY,
apiSecretKey: process.env.SHOPIFY_API_SECRET_KEY,
appUrl: process.env.SHOPIFY_APP_URL,
navLinks: [
{ label: 'Home', href: '/', rel: 'home' },
{ label: 'Products', href: '/products' },
{ label: 'Settings', href: '/settings' }
]
}
})
Key files
nuxt.config.ts— Module config: API credentials, scopes, navigation links, and other options. See Configuration for the full list.server/plugins/shopify.ts— Nitro plugin for complex runtime objects: session storage, lifecycle hooks, webhooks, and billing.layouts/default.vue— Wrap pages with<ShApp>to render the App Bridge navigation menu.server/api/*.ts— Server API routes using auto-imported utilities likeuseShopifyAdminanduseShopifyWebhook.
What the module registers automatically
You don't need to manually set up any of these — the module handles them:
| What | Description |
|---|---|
| OAuth routes | /_shopify/auth, /_shopify/auth/callback, exit-iframe, session-token |
| Server utilities | useShopifyAdmin, useShopifyWebhook, and more — auto-imported |
| Client composables | useAppBridge(), useShopifyFetch() — auto-imported |
| Components | ShApp, ShLoadingIndicator, Sh* Polaris wrappers — auto-registered |
| App Bridge | CDN script + meta tag injected via SSR head |
| Polaris | CDN script + web component types registered |
| Auth middleware | shopify-auth route middleware (opt-in, not global) |
| Default session storage | MemorySessionStorage (override via configureShopify()) |