@digitalygo/diggocms-sdk-core
v0.5.0
Published
Headless CMS SDK for React with base components, auto-rendering, and mock-friendly development
Readme
@digitalygo/diggocms-sdk-core
Core runtime for DiggoCMS payloads.
Install
bun add @digitalygo/diggocms-sdk-coreExports
- base components:
Title,Image,Card,Text,Video,Gallery,Hero,Map,Table - navigation:
MenuItem,MenuContainer - provider and hooks:
DiggoProvider,useDiggoConfig,useTheme,useComponentRegistry,useNavigationRegistry - helpers:
createDiggoSdk,createFetchHelpers,getUnboundRenderHelpers - render helpers:
renderComponent,renderPage,renderCollection,renderMenu
Server-only helpers live in @digitalygo/diggocms-sdk-core/server.
Current payload contract
Components use kind as discriminator.
| Kind | Fields |
| --- | --- |
| title | content |
| text | content |
| image | imageUrl, altText, description |
| video | videoUrl, posterUrl, altText, description |
| gallery | items |
| card | title, subtitle, imageUrl, imageAltText, cta |
| hero | backgroundImageUrl, backgroundImageAltText, title, subtitle, cta |
| map | poi |
| table | columns, rows |
Envelope fields include kind, variant, variantSource, order, and sortOrder.
subtitle and richtext are not standalone component kinds.
Basic setup
import { DiggoProvider, createDiggoSdk } from '@digitalygo/diggocms-sdk-core';
const componentsRegistry = {};
const navigationRegistry = {};
const config = {
baseUrl: process.env.BASE_URL ?? 'http://localhost:3001',
components: componentsRegistry,
navigation: navigationRegistry,
};
const sdk = createDiggoSdk(config);
export function App({ page, menu }) {
return (
<DiggoProvider config={config}>
{menu ? sdk.renderMenu(menu) : null}
{page ? sdk.renderPage(page) : null}
</DiggoProvider>
);
}Component registry rules
- register only supported kinds
- keep base props intact in extended components
- unknown kinds are skipped with a warning
- failing extensions fall back to base components
Skill support
This package bundles these AI skills under skill/, and skill:install/skill:update sync all packaged skills into .agents/skills/:
diggocms-sdk-developmentatskill/SKILL.mddiggocms-api-mock-migrationatskill/diggocms-api-mock-migration/SKILL.md
bun run skill:install
bun run skill:updateDevelopment
bun run dev
bun run build
bun run test