@eaera-com/cms-sdk
Data access layer for EAERA CMS front ends: typed services over ofetch, Pinia stores, and a Nuxt
module that handles sign-in with httpOnly cookies, for Nuxt 4 apps. Nuxt 4 is proven in CI by a Nuxt 4.5
fixture app (fixtures/nuxt4); the module also declares Nuxt ^3.0.0, which is declared, not re-proven.
- Current version: 0.2.0 (
package.json); check the registry withnpm view @eaera-com/cms-sdk dist-tags. - Owner: the People team (since 2026-11-03). Code owner:
@vietnq1806(.github/CODEOWNERS). - Changes:
CHANGELOG.md.
Install
The package is public on npmjs and needs no token:
pnpm add @eaera-com/cms-sdk
pinia (^3) and vue (^3.5) are peer dependencies. If your .npmrc still maps
@eaera-com:registry to GitHub Packages, you will not see new versions; see
docs/npm-publishing.md §4.
Entry points
| Import | What it is |
|---|---|
@eaera-com/cms-sdk | createCmsSDK(), the domain services (pack administration is sdk.packs since 0.2.0; the v2 people surface is gone), the Pinia stores (useAuthStore, useContentStore, …), createPersistPlugin, constants and types. Runs in the browser and on the server: it imports no h3. |
@eaera-com/cms-sdk/nuxt | The Nuxt module (config key cmsSdk): builds $cms, wires the stores and cookie persistence, and registers the /api/cms/* and /api/cms-sdk/* routes; each part can be turned off (stores, persist, serverRoutes, wsAutoOpen, see USAGE.md §2.1.1). |
@eaera-com/cms-sdk/server | Server-only helpers for an app's own Nitro routes (they import h3): the QwenPaw helpers postConsoleChatError, QwenpawConfigError, QwenpawUpstreamError, listQwenpawChats, listQwenpawGroups, getQwenpawChatMessages, deleteQwenpawChat, fetchChatHistory. On the root entry until 0.1.116. |
@eaera-com/cms-sdk/engine | Since 0.2.1: a same-origin engine client for an app whose own server proxies the engine and keeps the session (no token in the page): createEngineTransport, createEngineClient, createRegistry, the mapper (fromWire / toWire), the path guards (segment) and the refusal normaliser (normalise, RefusalPolicy). Browser-safe, independent of $cms and CmsError; see USAGE.md §4.4. |
Minimal Nuxt setup:
export default defineNuxtConfig({
modules: ['@pinia/nuxt', '@eaera-com/cms-sdk/nuxt'],
runtimeConfig: {
public: { cmsUrl: 'https://cms.example.com', clientId: 'web' },
},
});
Documentation
USAGE.md(Vietnamese): the full Nuxt flow: configuration, login, SSR / reload, logout, 401 refresh, where data is stored, mock mode, troubleshooting.docs/npm-publishing.md(Vietnamese): the publish pipeline, the one-time npm setup, the release steps and the consumer side.- Spec hub (architecture, SRS, ADRs, release plans):
cbs/cms-sdk/in theeaera-docsrepository.
Releasing
Publishing is tag-only (ADR-004). A push or merge to main publishes nothing. A vX.Y.Z tag on a
commit that is on main publishes to npmjs after the five ci.yaml checks pass (typecheck, test,
build + publint + scripts/check-package.mjs, format, and fixture-nuxt4: the Nuxt 4.5 fixture app
built and smoke-tested), and only when package.json has the same version and CHANGELOG.md has a
## X.Y.Z entry with a Consumer action: line and a Checked against: line. Tags
vX.Y.Z-next.N publish to the next dist-tag.
Only @vietnq1806 pushes v* tags. The repository is on the GitHub Free plan (ADR-004 amendment,
decision R-1), so GitHub enforces no branch protection, code-owner review or tag restriction. These
rules are team discipline: every change goes through a PR with the five checks green and a review by
@vietnq1806. Step-by-step instructions and the accepted residual risk are in
docs/npm-publishing.md §3 and §5.
License
See LICENSE and THIRD-PARTY-NOTICES.md.