@ungic/cms
v0.7.0
Published
The ungic CMS server: createCms(options) → a Hono app (content API, auth, admin routes, files, functions) over Postgres.
Maintainers
Readme
@ungic/cms
The ungic CMS server as a library: a Hono app with the content API (/api/v1), auth (password, phone / email codes), the admin routes, files and media, server functions and event handlers, over Postgres or PGlite.
Most Sites never call it directly: npm create @ungic my-site scaffolds a Site and the ungic CLI boots it
(ungic dev, ungic build, ungic start). Use this package for the Site's own code:
// ungic.config.ts — your configuration over the base (ungic.base.ts)
import { defineConfig, defineFunction, z } from '@ungic/cms';
import base from './ungic.base.js';
export default defineConfig({
base,
functions: {
quote: defineFunction({ input: z.object({ zoneId: z.string() }), handler: async ({ zoneId }, ctx) => ({ price: 20 }) }),
},
});createCmsFromConfig(config, { database })boots the CMS from a config;createCms(options)is the lower-level entry.- Migrations:
defineMigration,sql,planMigration,migrateSchema. Theungic-migratebin isungic migratefor a server of your own that does not use@ungic/cli.
Documentation
- Getting started · Base and config · Data and API
- Functions and hooks · Migrations · Apps · Admin
- Deployment (environment reference, storage, providers) · CLI reference · Upgrading
License: Apache-2.0.
