Installation
Get started with the Chat SDK React in just a few minutes.
Requirements
Before installing the SDK, make sure you have:
- Node.js 16.0.0 or higher
- React 18.0.0 or higher
- React DOM 18.0.0 or higher
- npm or yarn or pnpm package manager
Installation Steps
1. Install via npm
bash
npm install @cyborg-sdk/reactUsing yarn
bash
yarn add @cyborg-sdk/reactUsing pnpm
bash
pnpm add @cyborg-sdk/reactPeer Dependencies
The SDK requires React and React DOM as peer dependencies. They should already be in your project, but if not, install them:
bash
npm install react react-domNext Steps
After installation, proceed to the ChatProvider setup guide to integrate the SDK into your application.
Troubleshooting
Module not found error
If you encounter "Cannot find module '@cyborg-sdk/react'", ensure:
- The package is correctly installed:
npm ls @cyborg-sdk/react - You've cleared node_modules and reinstalled:
rm -rf node_modules && npm install - Your Node.js version is 16.0.0 or higher:
node --version
TypeScript issues
If using TypeScript, ensure your tsconfig.json has the following settings:
libincludes"DOM"and"ES2020"jsxis set to"react"or"react-jsx"skipLibCheckistrue(recommended for faster builds)
Build errors with Tailwind CSS
The SDK uses Tailwind CSS v4 with prefixed utilities. No additional configuration is required on your end, but ensure:
- You're not using conflicting CSS frameworks in your project
- Your CSS is loaded after the SDK's styles (typically automatic)