Registry / cms / nextly

nextly

JSON →
library0.0.2-alpha.20jsnpmunverified

Nextly is a headless CMS and app framework for Next.js, providing core functionality for database interaction, services, and APIs. It is currently in early alpha (v0.0.2-alpha.20) with rapid iteration, targeted at developers building content-driven Next.js applications. Key differentiators include tight Next.js integration, support for multiple database adapters (MySQL, SQLite, PostgreSQL via Drizzle), and TypeScript-first design. It requires Next.js ^14.0.0, ^15.0.0, or ^16.0.0 as a peer dependency, along with one of the database adapter packages. The library ships its own TypeScript types for a type-safe developer experience.

npm install nextly
INSTALL
IMPORT
SIG · NEXTLY
N
nextly
cmsjavascriptv0.0.2-alpha.20
harness data pending
Install & Compatibility
Where this runs

No compatibility data collected yet for this library.

Code
Verified usage

Verified import paths — ran on the pinned version, not inferred.

Nextly
import { Nextly } from 'nextly'
import Nextly from 'nextly'
Named export, not default. Requires ESM.
defineConfig
import { defineConfig } from 'nextly'
const defineConfig = require('nextly').defineConfig
Named export; CommonJS require may work but not recommended.
NextlyError
import { NextlyError } from 'nextly'
Named export for error handling.

Initializes Nextly with a PostgreSQL adapter, defines a content model, and creates an API route to fetch all posts.

import { Nextly } from 'nextly'; import { adapterPostgres } from '@nextlyhq/adapter-postgres'; const nextly = new Nextly({ adapter: adapterPostgres({ connectionString: process.env.DATABASE_URL ?? '' }) }); // Define a content model export const posts = nextly.define('post', { schema: { title: 'text', content: 'text', published: 'boolean' } }); // Create an API route handler export async function GET(request: Request) { const allPosts = await posts.findMany(); return new Response(JSON.stringify(allPosts), { headers: { 'Content-Type': 'application/json' } }); }
Debug
Known issues
breakingAPI changes between alpha versions: schema definitions and adapter APIs may change without notice.
fix
Pin to a specific alpha version and consult release notes before upgrading.
affects: >=0.0.2-alpha.0 <0.1.0
deprecatedThe 'define' method signature changed in v0.0.2-alpha.15: options object is now required.
fix
Pass options object as second argument to define().
affects: >=0.0.2-alpha.15
gotchaDatabase adapters must be explicitly installed; Nextly does not include them by default.
fix
Install one of @nextlyhq/adapter-mysql, @nextlyhq/adapter-sqlite, or @nextlyhq/adapter-postgres.
affects: >=0.0.2-alpha.0
gotchaNode.js version must be >=20.0.0; older versions will fail at runtime.
fix
Use Node.js 20 or later.
affects: >=0.0.2-alpha.0
gotchaTypeScript strict mode may cause type errors due to incomplete type definitions.
fix
Set strict: false in tsconfig.json or use type assertions.
affects: >=0.0.2-alpha.0
Errors
Common errors & fixes
Cannot find module '@nextlyhq/adapter-postgres'
The database adapter package is not installed.
fix
npm install @nextlyhq/adapter-postgres
TypeError: nextly.define is not a function
Using an older version where define was a property of the return value of another method, or the import is incorrect.
fix
Check import: import { Nextly } from 'nextly'. Then const posts = nextly.define('post', {...}).
Dynamic require of 'nextly' is not supported
Using CommonJS require() with an ESM-only module.
fix
Use import statements and set 'type': 'module' in package.json, or use .mjs file extension.
Property 'adapter' is missing in type 'typeof import'
TypeScript expects the adapter to be provided when instantiating Nextly; missing or wrong import.
fix
Ensure the adapter package is installed and imported correctly: import { adapterPostgres } from '@nextlyhq/adapter-postgres'.
Upgrade
Version history
0.0.2-alpha.20latest on npm
Audit
Dependencies
nextrequiredPeer dependency; Nextly integrates directly with Next.js
@nextlyhq/adapter-mysqloptionalPeer dependency; required MySQL adapter
@nextlyhq/adapter-sqliteoptionalPeer dependency; required SQLite adapter
@nextlyhq/adapter-postgresoptionalPeer dependency; required PostgreSQL adapter
Agent activity
54 hits · last 30 days
node
48
OpenAI (training)
1
Resources
packagenextly
nextly — npm install nextly · libregistry