Posts
List, search, and resolve posts via sdk.cms.posts. The dev server's in-memory CMS handler runs offline with full parity — status, group, search, and tag filters all work without a remote connection. Click a row to open the slug-based detail page.
| Title | Status | Group | Tags |
|---|---|---|---|
| No posts. | |||
data/posts.ts
import { createReoptSDK } from "@reopt-ai/brandapp-sdk";
const sdk = createReoptSDK({ /* ... */ });
// 가장 단순한 호출
const { records, total } = await sdk.cms.posts.list();
for (const post of records) {
console.log(post.id, post.slug, post.title, post.status);
}
// 필터 — published만, 특정 그룹, 검색어, 태그(OR), 페이지네이션
const published = await sdk.cms.posts.list({
status: "published",
groupId: "<group-uuid>",
search: "launch",
tags: ["product", "engineering"],
page: 1,
limit: 20,
sortBy: "publishedAt",
sortOrder: "desc",
});
// slug 기반 필터 (v2.1+) — env var(REOPT_BLOG_GROUP_ID) 하드코딩 대신 권장.
// brand 안에서 slug는 안정적이며, group 추가 시 env 추가 불필요.
const blogPosts = await sdk.cms.posts.list({
status: "published",
groupSlug: "blog",
});