Skip to main content

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 your tsconfig.json has appropriate settings:
tsconfig.json

Project Structure

Bot Project

bot.definition.ts
index.ts

Integration Project

integration.definition.ts
index.ts

Environment Variables

Store sensitive configuration in environment variables:
.env
Load them in your application:

Verification

Verify your installation:
verify.ts
Run the verification:

Next Steps

Bot SDK

Start building your first bot

Integration SDK

Create a platform integration