CWA 2.0 is in alpha: try it, build with it, give feedback. APIs can still change between releases; see Releases.
Overview
Nuxt Module
Who the Nuxt module section is for, what @cwa/nuxt does, and where to find each part of it.
This section is for front-end developers. It covers @cwa/nuxt, the front-end half of a CWA site: the Vue files you write for layouts, page templates and components, the composables they use, and the admin panel the module adds. For the Symfony side, see the API Bundle. If you're new to CWA, start with Core Concepts.
@cwa/nuxt connects a Nuxt application to the API. It resolves every URL to the right layout, page and components, keeps them in a reactive store, applies real-time updates through Mercure, and ships the sign-in pages and the inline admin. You own the Vue templates; CWA decides what data they receive and in what order they render.
Start with Module Setup to install it.
Paths in this section start at the project root of the components-web-app template. The Nuxt app is
app/ and its source directory is also app/, so CWA's Vue files are in app/app/cwa/ and your own pages in app/app/pages/. In a Nuxt project of your own, drop the first app/. See Where things live.Pages in This Section
| Section | Role | Go here for |
|---|---|---|
| Configuration | Reference | Every cwa: option in nuxt.config.ts, definePageMeta keys, site config and SEO |
| Building Your UI | Reference for each file type | Layouts, page templates, components and the CLI generator |
| Component Helpers | How-to | Images and uploads, collections, HTML content, real-time updates, forms |
| CWA Components | Reference | The components you place in templates: <CwaComponentGroup>, <CwaPage>, <CwaLink> |
| Composables | Reference | Every composable, with a table of which one to use |
| The useCwa() API | Advanced reference | The services behind the composables, for custom admin UIs and plugins |
| Authentication | How-to | Reading auth state, protecting pages, sign-in, password reset, registration |
| The CWA Layer | Reference | What the layer ships: auth pages, the admin panel, styling, the UI kit |
| PWA & Offline and Page Caching | Production | Service-worker caching and shared-cache headers for rendered pages |