Quick Start
1
Install
2
Create an agent (ESM or CommonJS)
- ESM
- CommonJS
Requires Node.js 18 or later (
engines.node >= 18).How It Works
Thepackage.json entry points tell each runtime and bundler which build to load.
import resolves to the ESM build, require resolves to the CJS build, and TypeScript reads the shared type declarations — no configuration needed on your side.
The ESM build is produced by a small shim that rewrites relative specifiers, adds a
createRequire banner for interop, and drops a dist/esm/package.json marked { "type": "module" }.
Using in Different Environments
Pick the entry point that matches where you run praisonai.- Node.js (CommonJS)
- Node.js (ESM)
- TypeScript
- Vite / Rollup / esbuild
- Next.js
- React Native (Metro)
- Deno / Bun
Deno and Bun resolve the ESM entry automatically from the
import condition.Subpath Imports
Import from a subpath to load only the module you need.Best Practices
Prefer ESM imports in new projects
Prefer ESM imports in new projects
Use
import { Agent } from 'praisonai' for new code. ESM is the default for bundlers and edge runtimes, and it preserves await import() as a lazy chunk instead of forcing a synchronous require().Bundle for the browser today — what works and what doesn't
Bundle for the browser today — what works and what doesn't
The root barrel (
praisonai) still pulls in the CLI and other Node-only code, so a raw import 'praisonai' in a browser or React Native bundle drags in Node built-ins. Use deep imports — for example praisonai/agent/simple — to keep browser and React Native bundles Node-safe.Verify your install with verify:dist
Verify your install with verify:dist
Contributors can run
npm run verify:dist to confirm both the CJS and ESM entry points load in a real Node process before publishing.Node version — 18 or later
Node version — 18 or later
The package sets
engines.node >= 18. The bundled openai dependency needs Node 18, so older runtimes are not supported.Related
Node.js Agents
Build agents in Node.js with ESM or CommonJS
TypeScript SDK
Full TypeScript agent framework reference

