@easy-cms/nuxt
@easy-cms/nuxt
Nuxt 4 module for Easy CMS: the REST API, the admin UI and a typed useEasyCMS() inside your Nuxt app. Part of Easy CMS, the embedded, code-first headless CMS for Nuxt and Next.js.
Install
npm install @easy-cms/nuxt @easy-cms/core @easy-cms/db-sqlite
Or pnpm add, yarn add or bun add.
Usage
// nuxt.config.ts
export default defineNuxtConfig({
modules: ['@easy-cms/nuxt'],
easyCms: {
// configPath: 'easy-cms.config.ts',
// trustProxy: false, // use X-Forwarded-For for login rate limiting
},
})
With easy-cms.config.ts in the project root you get:
-
REST API at
/api/cms(collections, globals, uploads, login/logout/me); change it withroutes.apiin the Easy CMS config. -
Admin UI at
/admin(admin.pathin the config). -
Local API in server routes, typed from your config:
// server/api/posts.get.ts export default defineEventHandler(async (event) => { const cms = await useEasyCMS() const user = await useEasyCMSUser(event) // logged-in Easy CMS user or null return cms.find('posts', { sort: '-createdAt', limit: 10 }) })
Development and production
nuxi devpushes schema changes to the database automatically.- In production the schema must match the latest migration. Create migrations with
npx easy-cms migrate:create <name>, deploy theeasy-cms/migrationsfolder, runnpx easy-cms migrate, then start the server from the project root (relative database paths and the migrations folder resolve from the working directory). - The module tells Nitro to ship files the database adapter loads dynamically (libsql's native
binary), so
.outputruns on its own. Build on the same OS/architecture you deploy to.
Links
Nuxt · Documentation (ภาษาไทย) · GitHub
MIT License
Related Packages
@mapled/nuxt
Read published Mapled content in a Nuxt site — a server-side client with a tag c...
508
Version History
| Version | Released | License |
|---|---|---|
| 1.4.2 | MIT | |
| 1.4.1 | MIT | |
| 1.4.0 | MIT | |
| 1.3.0 | MIT | |
| 1.2.0 | MIT | |
| 1.1.0 | MIT | |
| 1.0.1 | MIT | |
| 1.0.0 | MIT | |
| 0.68.5 | MIT | |
| 0.68.4 | MIT | |
| 0.68.3 | MIT | |
| 0.68.2 | MIT | |
| 0.68.1 | MIT | |
| 0.68.0 | MIT | |
| 0.67.2 | MIT | |
| 0.67.1 | MIT | |
| 0.67.0 | MIT | |
| 0.66.1 | MIT | |
| 0.66.0 | MIT | |
| 0.65.0 | MIT | |
| 0.64.0 | MIT | |
| 0.63.0 | MIT | |
| 0.62.0 | MIT | |
| 0.61.0 | MIT | |
| 0.60.0 | MIT | |
| 0.49.0 | MIT | |
| 0.48.0 | MIT | |
| 0.47.4 | MIT | |
| 0.47.3 | MIT | |
| 0.47.2 | MIT |
Showing the latest 30 of 87. See every release on npm
Pre-releases (1)
| Version | Released | License |
|---|---|---|
| 1.0.0-rc.0 | MIT |