@latimer-woods-tech/content
CRUD content management with Neon Postgres and optional LLM-assisted generation. Depends on@latimer-woods-tech/neon and @latimer-woods-tech/copy.
Documentation Index
Fetch the complete documentation index at: /llms.txt
Use this file to discover all available pages before exploring further.
Content management backed by Neon Postgres.
@latimer-woods-tech/neon and @latimer-woods-tech/copy.
npm install @latimer-woods-tech/content
import { CREATE_CONTENT_TABLE } from '@latimer-woods-tech/content';
await db.execute(CREATE_CONTENT_TABLE);
CREATE TABLE IF NOT EXISTS content (
id UUID PRIMARY KEY DEFAULT gen_random_uuid(),
app_id TEXT NOT NULL,
slug TEXT NOT NULL,
title TEXT NOT NULL,
body TEXT NOT NULL,
status TEXT DEFAULT 'draft',
author_id TEXT,
metadata JSONB DEFAULT '{}',
created_at TIMESTAMPTZ DEFAULT now(),
updated_at TIMESTAMPTZ DEFAULT now(),
UNIQUE (app_id, slug)
);
createContent(db, opts)function createContent(db: Db, opts: {
appId: string;
slug: string;
title: string;
body: string;
authorId?: string;
metadata?: Record<string, unknown>;
}): Promise<Content>;
getContent(db, appId, slug)function getContent(db: Db, appId: string, slug: string): Promise<Content | null>;
listContent(db, opts)function listContent(db: Db, opts: {
appId: string;
status?: 'draft' | 'published';
limit?: number;
offset?: number;
}): Promise<Content[]>;
updateContent(db, id, updates)function updateContent(
db: Db,
id: string,
updates: Partial<Pick<Content, 'title' | 'body' | 'status' | 'metadata'>>,
): Promise<Content>;
publishContent(db, id)function publishContent(db: Db, id: string): Promise<Content>;
import { createContent, publishContent } from '@latimer-woods-tech/content';
const article = await createContent(db, {
appId: 'focusbro',
slug: 'getting-started-with-focus',
title: 'Getting Started with Deep Focus',
body: '<p>...</p>',
authorId: user.id,
});
await publishContent(db, article.id);