Prerequisites
- Node.js 18.x or higher
- npm, yarn, or pnpm package manager
- TypeScript 5.0 or higher (recommended)
Installation
Install both the SDK and client packages:npm
yarn
pnpm
Package Overview
@botpress/sdk
The core SDK package provides:- Bot SDK -
BotDefinition,BotImplementation - Integration SDK -
IntegrationDefinition,IntegrationImplementation - Plugin SDK -
PluginDefinition,PluginImplementation - Schema Validation - Zod-based schema builder (
z) - Type Utilities - Type-safe helpers and utilities
@botpress/client
The client package provides:- Client - Main API client class
- Runtime API - Conversation, message, user, and state operations
- Admin API - Bot and integration management
- Error Types -
RuntimeError,isApiError
Importing the SDK
Full SDK Import
Named Imports
Client Import
TypeScript Configuration
Ensure yourtsconfig.json has appropriate settings:
tsconfig.json
Project Structure
Bot Project
Integration Project
Environment Variables
Store sensitive configuration in environment variables:.env
Verification
Verify your installation:verify.ts
Next Steps
Bot SDK
Start building your first bot
Integration SDK
Create a platform integration