JSPM

  • ESM via JSPM
  • ES Module Entrypoint
  • Export Map
  • Keywords
  • License
  • Repository URL
  • TypeScript Types
  • README
  • Created
  • Published
  • Downloads 499
  • Score
    100M100P100Q117028F
  • License MIT

Server-side core for NexPress — collections pipeline, auth, jobs, media, plugins, observability.

Package Exports

  • @nexpress/core
  • @nexpress/core/auth
  • @nexpress/core/community
  • @nexpress/core/db
  • @nexpress/core/db-schema
  • @nexpress/core/i18n
  • @nexpress/core/jobs
  • @nexpress/core/media
  • @nexpress/core/observability
  • @nexpress/core/rate-limit
  • @nexpress/core/routes
  • @nexpress/core/seo

Readme

@nexpress/core

Server-only core for NexPress — the Next.js-based CMS. Houses the collections pipeline, auth, jobs, media, plugins, observability, SEO helpers, i18n, and the multi-site model.

You probably don't install this directly. It's wired up by @nexpress/next from a project scaffolded with npx create-nexpress. If you're adding a custom backend behavior to a NexPress site, see docs/plugin-render.md first — most extension points live in the plugin SDK, not core.

Install

pnpm add @nexpress/core

Server-only — @nexpress/core imports pg, sharp, @node-rs/argon2, pg-boss, jose. Importing it from a client component breaks the build. The standard NexPress app declares it in serverExternalPackages.

Subpath exports

Domain-bounded entries — prefer these over the catch-all root:

import { can } from "@nexpress/core/auth";
import { enqueueJob } from "@nexpress/core/jobs";
import { getLogger } from "@nexpress/core/observability";
import { buildSitemap } from "@nexpress/core/seo";
import { t } from "@nexpress/core/i18n";

Available subpaths: auth, community, db, i18n, jobs, media, observability, seo. The root @nexpress/core keeps re-exporting everything for back-compat.

Quick example

import { defineCollection } from "@nexpress/core";

export const posts = defineCollection({
  slug: "posts",
  labels: { singular: "Post", plural: "Posts" },
  fields: [
    { name: "title", type: "text", required: true },
    { name: "body", type: "richText" },
    { name: "publishedAt", type: "date" },
  ],
});

The collection becomes a typed Drizzle table, generated Zod validators, and a CRUD API at /api/collections/posts once you re-run pnpm db:generate && pnpm db:migrate.

License

MIT