The @laioutr-app/shopware package integrates a Laioutr-powered Nuxt app with a Shopware backend. It registers with the Laioutr orchestr (queries, actions, links, resolvers, templates), provides a Nuxt Image provider for Shopware media, and a media library provider for the Laioutr Studio. All communication uses the official Storefront API (customer-facing) and Admin API (OAuth2 client credentials) from @shopware/api-client.
To use it, you add the module to your Nuxt config and configure the five required connection options (storefront endpoint and token, admin endpoint and OAuth client). The package then exposes canonical ecommerce capabilities (products, categories, cart, search, menu, auth, newsletter, reviews) so your UI can stay backend-agnostic while talking to Shopware.
The module expects configuration under the key @laioutr-app/shopware in nuxt.config.ts (or via runtimeConfig). All five options are required for the package to work correctly.
| Option | Type | Description |
|---|---|---|
endpoint | string | Base URL of the Shopware Storefront API (e.g. https://your-store.example.com/store-api or the URL your Shopware instance exposes for the store API). |
accessToken | string | Storefront API access token. In Shopware this is typically a sales channel–specific token that allows public storefront access. Create or copy it from the Sales Channel in the Admin (Storefront API access). |
adminEndpoint | string | Base URL of the Shopware Admin API (e.g. https://your-store.example.com/api). Used for the media library provider and any server-side admin operations. |
adminClientId | string | OAuth2 Client ID for the Admin API. Created in Shopware Admin under Settings → System → Integrations (or API → Integrations). The integration must have the scopes needed for the operations you use (e.g. media read for the media library). |
adminClientSecret | string | OAuth2 Client Secret for the same Admin API integration. Keep this secret and only use it on the server (the module stores it in private runtime config). |
// nuxt.config.ts
export default defineNuxtConfig({
modules: ['@laioutr-app/shopware'],
'@laioutr-app/shopware': {
endpoint: process.env.SHOPWARE_STOREFRONT_ENDPOINT!,
accessToken: process.env.SHOPWARE_STOREFRONT_ACCESS_TOKEN!,
adminEndpoint: process.env.SHOPWARE_ADMIN_ENDPOINT!,
adminClientId: process.env.SHOPWARE_ADMIN_CLIENT_ID!,
adminClientSecret: process.env.SHOPWARE_ADMIN_CLIENT_SECRET!,
},
});
Use environment variables (or a similar secret source) for all five values in production; do not commit tokens or secrets.
endpoint, accessToken, and a context token read from the cookie sw-context-token (cart/session). It sets default headers sw-include-seo-urls: true and, after resolving system entities, sw-currency-id and sw-language-id from the current client context (locale/currency).adminEndpoint and OAuth2 client_credentials using adminClientId and adminClientSecret. It is used for the media library provider (list/search media) and any future admin-only features.The package implements Laioutr’s canonical ecommerce types via the orchestr. The following lists what is available; for exact types and payloads, refer to @laioutr-core/canonical-types and the package source.
sw-context-token cookie.shopwaresrc that can include a fragment with thumbnail info (e.g. url widthxheight, ...). It picks the best-matching thumbnail for the requested width/height (or the largest if no size is requested).shopware provider name.shopware@shopware/api-client (Storefront and Admin APIs). Use a Shopware version that is supported by that client (typically Shopware 6.x with a compatible Storefront API and Admin API).media read).The Storefront API uses a context token to identify the session (cart, customer). The package:
sw-context-token on each storefront request.path: '/', long-lived maxAge, sameSite: 'lax', and secure when the storefront endpoint is HTTPS.Ensure your domain and cookie settings align with your Shopware sales channel and storefront URL so the same context is used consistently.
@laioutr-app/shopware to modules and set all five options under '@laioutr-app/shopware' (endpoint, accessToken, adminEndpoint, adminClientId, adminClientSecret).shopware Nuxt Image provider for Shopware media when using the expected src format.shopware media library provider will work once the Admin API and integration are correctly configured.For type-level details and exact canonical action/query names, see the package source and @laioutr-core/canonical-types in the laioutr repository.
Shopify
Developer documentation for the Laioutr Shopify app package. Connect your Nuxt frontend to a Shopify store via the Storefront API, Admin API, and Customer Account API.
Vercel Analytics
Developer documentation for the Laioutr Vercel Analytics app package. Add Vercel Analytics to your Nuxt app via a Laioutr page wrapper.