Supported runtimes: The TypeScript SDK runs in any JavaScript runtime — Node, Bun, Deno, browser bundles, Tauri, React Native, Cloudflare Workers. Pass the API key through the
Agent config on runtimes that lack process.env. See Browser & Mobile Runtimes for the patterns.- TypeScript
Quick Start
1
Simple Usage
As of v1.7.4, praisonai requires Node.js 18 or later (
openai@4 needs Node 18+). Importing the package no longer requires OPENAI_API_KEY — the key is only checked when an OpenAI client is created, so Anthropic and Google users can import { Agent } from 'praisonai' without one.v-next (from PR #4416): praisonai-ts no longer runs dotenv.config() on import, and no longer reads process.env.LOGLEVEL at import. The package is safe to import in any JavaScript runtime (browser, Electron renderer, webview, React Native). If you relied on the automatic .env load, install dotenv yourself and call dotenv.config() at the top of your entrypoint — see JS Import Safety & Runtimes.Building for mobile or a webview (Tauri, Electron renderer, React Native, iOS/Android WebView)? Import from the The package root is not webview-safe by design (it re-exports the CLI and MCP server). See Browser & Webview Runtimes.
praisonai/mobile entry:2
With Configuration
3
Create File
4
Run Script
Source & contributing: the TypeScript/JavaScript SDK is developed in
MervinPraison/PraisonAI at src/praisonai-ts/. The praisonai-js repo is only the npm mirror — file issues and PRs against the main monorepo. See Contributing.Usage Examples
Single Agent Example
Single Agent Example
Create and run a single agent to perform a specific task:
Multi-Agent Example
Multi-Agent Example
Create and run multiple agents working together:
Task-Based Agent Example
Task-Based Agent Example
Create agents with specific tasks and dependencies:
Running the Examples
1
Set Environment Variables
2
Create Example File
Create a new TypeScript file (e.g.,
app.ts) with any of the above examples.3
Run the Example
Tool Calls Examples
Direct Function Tools
Direct Function Tools
Create an agent with directly registered function tools:
Package Structure
PraisonAI ships two entry points from one package.praisonai— the full framework: agents, tools, MCP, CLI, and everything else. Import this in Node and server builds.praisonai/mobile— a webview-safe subpath export (~77 kB bundle). ImportAgentand its types from here in phone, browser, or Tauri builds. See Mobile Entry for details.
Parity Notices
A few Python names resolve differently in the TypeScript SDK. Reach for the runtime entry point below.Some Python methods on
Agent, Team, and Session have no TypeScript counterpart yet. The pages below flag the gaps; the full list lives in the SDK parity baseline.Related
TypeScript Async
TypeScript Async overview
Mobile Entry
Webview-safe bundle from praisonai/mobile
Agent
Agent overview
Browser & Mobile
Run in Tauri, React Native, browser, and edge runtimes

