@octaviatech/cms
v0.1.11
Published
Octavia AI CMS Service SDK (JavaScript/TypeScript)
Readme
@octaviatech/cms
Simple, typed SDK for the Octavia CMS API --- build, manage, and ship multilingual content with a clean, unified response structure.
🚀 Get an API Key (Free)
To use the SDK, create a free Octavia account and generate your API key:
- Sign up at: https://octaviatech.app
- Go to your dashboard → Select Your Service → API Keys → Create Key
- Copy your key and initialize the SDK
Keep your API key private. For frontend apps, proxy requests through your backend.
📦 Installation
npm install @octaviatech/cms
# or
yarn add @octaviatech/cms
# or
pnpm add @octaviatech/cms⚡ Quick Start
import CMS from "@octaviatech/cms";
const cms = CMS.init("your-api-key");
const newArticle = {
mainTitle: { en: "Hello" },
body: { en: "Content" },
category: "CATEGORY_ID",
author: "AUTHOR_ID",
};
const { data, ok, error } = await cms.article.create(newArticle);
if (!ok) {
throw new Error(error?.message || "Request failed");
}
console.log("Created:", data);🔧 Advanced Configuration
const cms = CMS.init("your-api-key", {
timeoutMs: 10000,
});📘 Unified Response Shape
All SDK calls return:
{
ok: boolean;
data: T | null;
error?: { message: string; statusCode?: number };
meta?: { pagination?: unknown };
}🔍 Query Example
const { data, ok, error } = await cms.article.getAll({
lang: ["en", "fa"],
page: 1,
limit: 10,
sort: "desc",
});
if (!ok) throw new Error(error?.message);
console.log(data, meta);📚 Available Resources
- cms.ai
- cms.article
- cms.author
- cms.category
- cms.subcategory
- cms.form
- cms.formSubmission
- cms.language
- cms.report
- cms.raw (low-level client)
📖 Documentation & Examples
- Full documentation: https://developers.octaviatech.app
- Example projects: https://github.com/octavia-tech/octavia-ai-cms-sdk/tree/main/examples
🛡 License
ISC
