@eaera-com/cms-sdk

中文文档
0.2.1发布于 2026/11/13SEE LICENSE IN LICENSETypeScriptES Module近 30 天下载 2063

EAERA CMS SDK — data access layer for Nuxt 4 apps (ofetch + Pinia + typed services)

原始使用文档
文档目录5 节
  1. Install
  2. Entry points
  3. Documentation
  4. Releasing
  5. License

@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 with npm 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

ImportWhat it is
@eaera-com/cms-sdkcreateCmsSDK(), 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/nuxtThe 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/serverServer-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/engineSince 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 the eaera-docs repository.

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.

版本与发布记录

@eaera-com/cms-sdk 共发布 57 个版本,首次发布于 2026/09/15;过去 12 个月发布了 57 个版本。

版本发布日期距今
0.2.1latest2026/11/131 天前
0.2.02026/11/122 天前
0.1.1162026/11/113 天前
0.1.1152026/11/104 天前
0.1.1142026/10/3015 天前
0.1.1132026/10/2916 天前

关于 @eaera-com/cms-sdk 的常见问题

@eaera-com/cms-sdk 是什么?

EAERA CMS SDK — data access layer for Nuxt 4 apps (ofetch + Pinia + typed services)

如何安装 @eaera-com/cms-sdk?

在项目目录运行 npm install @eaera-com/cms-sdk,或使用 pnpm add / yarn add / bun add。它还需要宿主项目提供 peer 依赖:vue(^3.5.0)、pinia(^3.0.4)。npm 7 及以上与 pnpm 8 及以上默认会自动安装必需的 peer 依赖,Yarn 需要手动安装。

@eaera-com/cms-sdk 支持 TypeScript 吗?

支持。包内自带 TypeScript 类型声明(package.json 声明了 types 入口),安装后即可获得类型提示,无需再安装 @types 包。

@eaera-com/cms-sdk 支持 ESM 还是 CommonJS?

以 ES Module 形式发布,推荐使用 import 引入。在 CommonJS 项目中,Node.js 20.19+ / 22.12+ 可以直接 require() 不含顶层 await 的 ES Module,更早的版本需要改用动态 import()。

@eaera-com/cms-sdk 需要什么版本的 Node.js?

package.json 的 engines 字段要求 Node.js >=20.0.0。版本不符时 npm 默认只给出警告,开启 engine-strict 后会拒绝安装。

@eaera-com/cms-sdk 可以商用吗?

@eaera-com/cms-sdk 使用 SEE LICENSE IN LICENSE 许可。许可条款写在包内的独立文件中,请阅读该文件确认可否商用。以上为概括,不构成法律意见,请以许可原文为准。

@eaera-com/cms-sdk 的下载量有多少?

根据 npm 官方下载统计,@eaera-com/cms-sdk 在 2026/10/13 – 2026/11/11 这 30 天内被下载 2,063 次,日均约 69 次。下载量会把 CI 构建、镜像同步和作为其他包依赖的安装一并计入,适合横向比较热度,不能直接等同于使用人数。

@eaera-com/cms-sdk 还在维护吗?

最新版本 0.2.1 发布于 2026/11/13(1 天前);至今共发布 57 个版本,其中过去 12 个月发布了 57 个;首次发布于 2026/09/15。发布频率只是参考信号:功能稳定的工具可能很少需要更新,建议结合源码仓库的 issue 和提交记录判断。