Commercetools integration for Laioutr frontends using Nuxt. Connects to the Commercetools Platform API via the orchestr system, enabling backend-agnostic ecommerce functionality.
- Anonymous and client credentials authentication flows with secure cookie-based token caching
- Product queries by slug and category with variant resolution
- Cart management with line item support
- Menu and category browsing
- Faceted search with customizable filters and sorting
- Canonical type resolvers for Cart, MenuItem, Product, and ProductVariant
Before installing dependencies, you need to create a copy of the .npmrc.config file called .npmrc and fill in the NPM_LAIOUTR_TOKEN with your npm token. You can find this token in your project settings.
pnpm inpx @laioutr/cli project fetch-rc -p <organization slug>/<project slug> -s <project secret key>- This will load thelaioutrrc.jsonfile with the current remote project configuration.pnpm dev:preparepnpm orchestr-dev
That's it! You can now use the Commercetools App in your Laioutr Frontend.
You can find a thorough guide on getting started with Laioutr development in our developer guide.
You will need the following from the Commercetools Merchant Center:
- Project Key
- API URL and Auth URL (region-specific)
- Client ID and Client Secret
Your Commercetools project should have:
- Published products with locale-specific slugs
- Categories with keys and slugs
- Inventory/availability configured
- Searchable attributes marked in product types
- Anonymous sessions enabled (for guest cart functionality)
For detailed configuration instructions, see the documentation.
We use ESLint and Prettier to lint and format the code. This repository contains opinionated configurations for both tools. You can replace them with your own configurations.
To publish a new version, run pnpm release. This will:
- Run the tests
- Update the changelog
- Publish the package to npmjs.org
- Push the changes to the repository
If you want to publish a private package to npm.laioutr.cloud, you need to:
- Make sure you have a
.npmrcwith your private npm registry token. - Add this line to the root of the
package.jsonfile:"publishConfig": { "registry": "https://npm.laioutr.cloud/" } - Make sure your package-name follows the
@laioutr-org/<organization-slug>_<package-name>format.
After that you can run pnpm release to publish the package to npm.laioutr.cloud.
Follow the setup guide to get started.