The @laioutr/app-oxid package integrates a Laioutr-powered Nuxt app with OXID eShop. It uses the OXID GraphQL API for products, categories, search, basket (cart), and menu. The package registers with the Laioutr orchestr (queries, actions, links, component resolvers, query template providers) and provides a Nuxt Image provider that selects the best-fit OXID thumbnail for requested dimensions.
Auth is token-based: the module logs in with a configured user and password to obtain a Bearer token, which is then used for all GraphQL requests. The cart is identified by a basket ID stored in a cookie; the middleware ensures a basket exists on each request and creates one if missing.
To use it, add the module to your Nuxt config and set the GraphQL URL plus user credentials. The package then exposes canonical ecommerce capabilities so your UI can stay backend-agnostic while talking to OXID.
The module expects configuration under the key @laioutr/app-oxid in nuxt.config.ts (or via runtimeConfig). Three options are required; image sizes are optional with defaults.
| Option | Type | Description |
|---|---|---|
graphqlURL | string | OXID GraphQL API base URL (e.g. your OXID GraphQL endpoint). |
user | string | API user name used to obtain the Bearer token (login). |
password | string | API password for the same user. Keep this secret and only use it on the server. |
imagesConfig | object | Optional. Thumbnail size presets used by OXID and by the image provider. See OXID image configuration. |
| Property | Type | Default | Description |
|---|---|---|---|
thumbImageSize | { width: number; height: number } | { width: 500, height: 500 } | Thumbnail dimensions. |
iconImageSize | { width: number; height: number } | { width: 100, height: 100 } | Icon/small image dimensions. |
zoomImageSize | { width: number; height: number } | { width: 1200, height: 1200 } | Zoom/large image dimensions. |
// nuxt.config.ts
export default defineNuxtConfig({
modules: ['@laioutr/app-oxid', '@laioutr-core/orchestr', '@nuxt/image'],
'@laioutr/app-oxid': {
graphqlURL: process.env.OXID_GRAPHQL_URL!,
user: process.env.OXID_USER!,
password: process.env.OXID_PASSWORD!,
imagesConfig: {
thumbImageSize: { width: 500, height: 500 },
iconImageSize: { width: 60, height: 60 },
zoomImageSize: { width: 600, height: 600 },
},
},
});
Use environment variables for user and password in production; do not commit them.
user and password to obtain a Bearer token, then sends it in the Authorization header for all subsequent requests (categories, products, basket).oxid-basket-id. If missing, it creates a new basket via the BasketCreate mutation and sets the returned basket ID in the cookie (oxid-basket-id, httpOnly, secure, sameSite: none, path: /, maxAge: 30 days). Cart queries and add-to-cart actions use this basket ID.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.
{ id: basket.id } or { id: undefined } if no basket.alias === "root" returns top-level categories; otherwise returns children of the category identified by the alias (parsed from a composite menu id). Results stored in categoriesPassthroughToken. Returns category IDs.{ id }.ids, availableFilters, availableSortings.categorySlug (from category SEO slug).alias: "root" or alias derived from category id for submenus.type === "product" are added via the basket add-item mutation (productId, amount). Uses the basket ID from the request context (cookie). Other item types are ignored.oxidsrc can contain a fragment (#) with a comma-separated list of “url widthxheight” thumbnails (e.g. from OXID’s responsive image data). The provider picks the best-fit thumbnail for the requested width and height modifiers (smallest image that is at least as large as the requested size). If no fragment is present, the original URL is used.@nuxt/image; ensure the Nuxt Image module is installed.oxid-basket-id cookie (sameSite and secure settings are configured by the package)./, maxAge: 30 days. Ensure your deployment domain and HTTPS setup allow this cookie to be sent and received.@laioutr/app-oxid to modules and set graphqlURL, user, password under '@laioutr/app-oxid'. Optionally set imagesConfig.oxid Nuxt Image provider for OXID media when you have thumbnail lists in the src fragment; otherwise use the raw URL.