New Research: Supply Chain Attack on Axios Pulls Malicious Dependency from npm.Details →
Socket
Book a DemoSign in
Socket

@kyro-cms/core

Package Overview
Dependencies
Maintainers
1
Versions
2
Alerts
File Explorer

Advanced tools

Socket logo

Install Socket

Detect and block malicious and high-risk dependencies

Install

@kyro-cms/core

Astro-native headless CMS with multi-database adapters, multi-protocol APIs, and multi-vendor support

latest
Source
npmnpm
Version
0.1.1
Version published
Weekly downloads
0
Maintainers
1
Weekly downloads
 
Created
Source

Kyro CMS

Astro-Native Headless CMS with Multi-Database Adapters, Multi-Protocol APIs, and Multi-Vendor Support

npm version License: MIT TypeScript

Why Kyro?

Kyro is built for Astro from the ground up. Unlike other CMS solutions that bolt on Astro support, Kyro is architected to leverage Astro's islands architecture, server output modes, and performance-first approach.

Key Features

  • Local-First - SQLite for zero-config development, no external database needed
  • Multi-Database - SQLite, PostgreSQL, MySQL, MongoDB via unified adapter interface
  • Multi-Protocol API - REST, GraphQL, tRPC, and WebSocket from a single config
  • Multi-Vendor - Built-in tenant scoping and row-level access control
  • E-Commerce Ready - Products, orders, customers, inventory, coupons out of the box
  • Plugin System - Extend with SEO, analytics, reviews, and more
  • Any Styling - Tailwind, CSS Modules, Styled Components, or plain CSS

Quick Start

npm create kyro@latest

This launches an interactive wizard that asks:

  • Project name
  • Database (SQLite, PostgreSQL, MySQL, MongoDB)
  • API protocols (REST, GraphQL, tRPC, WebSocket)
  • Styling (Tailwind, CSS Modules, Styled Components, None)
  • Authentication (JWT)
  • Versioning/Drafts
  • Admin dashboard
  • Starting template (Minimal, Blog, E-commerce)

Option 2: Add to Existing Project

npm install @kyro-cms/core
// kyro.config.ts
import { defineConfig, localAdapter } from '@kyro-cms/core';

export default defineConfig({
  name: 'my-app',
  adapter: localAdapter({ path: './data.db' }),
  collections: {
    posts: {
      slug: 'posts',
      label: 'Posts',
      fields: [
        { name: 'title', type: 'text', required: true },
        { name: 'slug', type: 'text', required: true },
        { name: 'content', type: 'richtext' },
        { name: 'published', type: 'checkbox', defaultValue: false },
      ],
    },
  },
  api: {
    rest: true,
    graphql: true,
  },
});

Database Adapters

SQLite (Local-First)

import { localAdapter } from '@kyro-cms/core';

const adapter = localAdapter({
  path: './data.db',  // or ':memory:' for in-memory
});

Perfect for development and small projects. Zero configuration required.

PostgreSQL/MySQL (Production)

import { drizzleAdapter } from '@kyro-cms/core';

const adapter = drizzleAdapter({
  connectionString: process.env.DATABASE_URL,
});

MongoDB (Flexible Schemas)

import { mongoAdapter } from '@kyro-cms/core';

const adapter = mongoAdapter({
  connectionString: process.env.MONGODB_URI,
});

API Protocols

Kyro exposes your data through multiple protocols simultaneously.

REST API

# List documents
GET /api/posts

# Get single document
GET /api/posts/:id

# Create document
POST /api/posts
{ "title": "Hello World" }

# Update document
PATCH /api/posts/:id
{ "title": "Updated Title" }

# Delete document
DELETE /api/posts/:id

GraphQL

query {
  postsFind(where: {}, page: 1, limit: 10) {
    docs {
      id
      title
      slug
    }
    totalDocs
  }
}

mutation {
  postsCreate(data: { title: "New Post", slug: "new-post" }) {
    doc {
      id
      title
    }
  }
}

tRPC

const client = createTRPCClient({
  router: kyro.router,
  transformer: superjson,
});

// Type-safe queries
const posts = await client.posts.find.query({ page: 1 });
const newPost = await client.posts.create.mutate({
  title: "Hello",
  slug: "hello"
});

WebSocket (Real-time)

const ws = new WebSocket('ws://localhost:4321/api/ws');

ws.send(JSON.stringify({
  type: 'subscribe',
  collection: 'posts',
  event: 'create'
}));

ws.onmessage = (event) => {
  const data = JSON.parse(event.data);
  // Handle real-time updates
};

Field Types

Kyro supports 21 field types:

TypeDescription
textSingle-line text input
textareaMulti-line text
richtextRich text editor content
markdownMarkdown content
numberNumeric values
emailEmail with validation
passwordHashed password storage
checkboxBoolean toggle
dateDate/time picker
selectDropdown selection
radioRadio button group
colorColor picker
jsonJSON data
codeCode editor content
arrayRepeatable field groups
groupNested field groups
relationshipLink to other documents
uploadFile/media uploads
blocksStructured content blocks
rowHorizontal field layout
collapsibleCollapsible field sections
tabsTabbed interface

Example: Complex Fields

fields: [
  { name: 'title', type: 'text', required: true },
  
  {
    name: 'author',
    type: 'relationship',
    relationTo: 'users',
    required: true
  },
  
  {
    name: 'tags',
    type: 'array',
    fields: [
      { name: 'name', type: 'text' },
      { name: 'slug', type: 'text' },
    ]
  },
  
  {
    name: 'metadata',
    type: 'group',
    fields: [
      { name: 'views', type: 'number', defaultValue: 0 },
      { name: 'featured', type: 'checkbox' },
    ]
  }
]

E-Commerce Collections

Pre-built collections for building online stores:

import { ecommerceCollections } from '@kyro-cms/core';

const kyro = createKyro({
  adapter: localAdapter({ path: './store.db' }),
  collections: ecommerceCollections,
});

// Includes:
// - products (with variants, pricing, inventory)
// - categories (hierarchical)
// - customers (with addresses)
// - orders (with items, status tracking)
// - coupons (percentage, fixed, free shipping)
// - store settings (globals)

Authentication

Built-in JWT authentication:

import { Auth, createAuth } from '@kyro-cms/core';

const auth = createAuth(adapter, {
  secret: process.env.JWT_SECRET,
  expiresIn: '24h',
  refreshExpiresIn: '7d',
});

// Register
await auth.register({
  email: 'user@example.com',
  password: 'secure123',
  role: 'customer',
});

// Login
const result = await auth.login({
  email: 'user@example.com',
  password: 'secure123',
});

console.log(result.token); // JWT token

Version History & Drafts

Track document changes with built-in versioning:

import { createVersionManager } from '@kyro-cms/core';

const versions = createVersionManager(adapter, {
  versioningEnabled: true,
  maxVersionsPerDocument: 50,
});

// Create a new version
const version = await versions.createVersion({
  collection: 'posts',
  documentId: 'abc123',
  data: { title: 'Updated Post' },
  status: 'draft',
  createdBy: 'user123',
});

// Publish
await versions.publishVersion({
  collection: 'posts',
  documentId: 'abc123',
  versionId: version.id,
  publishedBy: 'user123',
});

Admin Dashboard

Kyro includes a full admin dashboard:

npm install @kyro-cms/admin
---
// admin/index.astro
import { Admin } from '@kyro-cms/admin';
import config from '../kyro.config';
---

<Admin client:load config={config} />

Features:

  • Collection browser with filtering and sorting
  • Document editor with all field types
  • Media library
  • Global settings editor
  • Dark mode support

Plugin System

Extend Kyro with plugins:

import { 
  KyroPlugin,
  SEOPLugin,
  AnalyticsPlugin,
  CommentsPlugin,
  ReviewsPlugin,
  WishlistPlugin 
} from '@kyro-cms/core';

const kyro = createKyro({
  adapter: localAdapter(),
  collections: [...],
  plugins: [
    new SEOPLugin({
      sitemap: true,
      robotsTxt: true,
    }),
    new AnalyticsPlugin({
      providers: ['google', 'plausible'],
    }),
    new CommentsPlugin(),
    new ReviewsPlugin(),
  ],
});

Creating Plugins

import { KyroPlugin } from '@kyro-cms/core';

class MyPlugin extends KyroPlugin {
  name = 'my-plugin';
  
  hooks = {
    'collection.beforeCreate': async (args) => {
      // Transform data before creation
      return { ...args, data: { ...args.data, source: 'my-plugin' } };
    },
    
    'document.afterSave': async (args) => {
      // Send webhook, log analytics, etc.
      await sendWebhook(args);
    },
  };
}

Styling System

Kyro ships with a complete styling system:

import { 
  ecommerce2026Theme,
  generateCSSVariables,
  generateTailwindConfig 
} from '@kyro-cms/core';

// Generate CSS variables
const cssVars = generateCSSVariables(ecommerce2026Theme);

// Generate Tailwind config
const tailwindConfig = generateTailwindConfig(ecommerce2026Theme);

// Custom themes
import { createAdminStyling } from '@kyro-cms/core';

const myTheme = createAdminStyling({
  primaryColor: '#6366f1',
  borderRadius: 'medium',
  fontFamily: 'Inter',
});

Deployment

Vercel

vercel --prod

Environment variables:

  • DATABASE_URL - PostgreSQL connection string
  • JWT_SECRET - JWT signing secret

Railway

railway up

Docker

cd deployments/docker
docker-compose up -d

See deployments/ for complete configuration.

Project Structure

kyro-cms/
├── packages/
│   └── create-kyro/        # Project scaffolding CLI
├── src/
│   ├── index.ts             # Main exports
│   ├── createKyro.ts        # Factory function
│   ├── registry/            # Config registry & validation
│   ├── fields/              # 21 field type definitions
│   ├── database/            # Adapter implementations
│   │   ├── local/           # SQLite adapter
│   │   ├── drizzle/         # SQL adapters
│   │   └── mongodb/         # MongoDB adapter
│   ├── api/                 # Multi-protocol gateway
│   │   ├── rest/            # Hono REST
│   │   ├── graphql/         # GraphQL schema
│   │   ├── trpc/            # tRPC router
│   │   └── ws/              # WebSocket server
│   ├── auth/                # JWT authentication
│   ├── versions/            # Version history
│   ├── plugins/             # Plugin system
│   ├── styling/             # Theming
│   └── cli/                 # CLI tools
├── admin/                   # Admin dashboard (Astro)
├── examples/                # Example configurations
├── docs/                    # Documentation
└── deployments/             # Deployment configs

CLI Commands

# Initialize a new project
npm create kyro@latest

# Generate TypeScript types
kyro generate

# Push schema to database
kyro push

# Open database studio
kyro studio

# Check system health
kyro health

Documentation

Contributing

Contributions are welcome! Please read our contributing guide before submitting PRs.

  • Fork the repository
  • Create your feature branch (git checkout -b feature/amazing)
  • Commit your changes (git commit -m 'Add amazing feature')
  • Push to the branch (git push origin feature/amazing)
  • Open a Pull Request

License

MIT License - see LICENSE for details.

Acknowledgments

Built with inspiration from:

  • Payload CMS - The headless CMS that pushed the industry forward
  • Strapi - Open source headless CMS
  • Sanity - Real-time content infrastructure

Keywords

cms

FAQs

Package last updated on 02 Apr 2026

Did you know?

Socket

Socket for GitHub automatically highlights issues in each pull request and monitors the health of all your open source dependencies. Discover the contents of your packages and block harmful activity before you install or update your dependencies.

Install

Related posts