Installation & Quick Start
Get up and running with @termix-it/react-tool in just a few minutes.Prerequisites
Before installing the library, make sure you have:- React 16.9.0 or later
- Node.js 14 or later
- A Termix project with AI configuration set up
Installation
Install the library using your preferred package manager:Dependencies
This library requires the following peer dependencies:Styles
Styles are now automatically bundled with the components - no separate CSS import needed! All styles are scoped with.termix-
prefix to prevent conflicts.
If you’re already using Tailwind CSS in your project, the bundled styles won’t conflict with your existing styles due to the
.termix-
prefix scoping.Basic Setup
Here’s the minimal setup to get a chat interface running:App.tsx
Alternative Setups
ChatWidget for Floating Interface
For a non-intrusive floating chat widget, use theChatWidget
component:
FloatingChat.tsx
Streaming Mode Setup
Enable real-time streaming responses for a more dynamic experience:StreamingChat.tsx
Configuration Parameters
You’ll need these essential parameters to get started:Your Termix project identifier. You can find this in your Termix dashboard.
AI configuration identifier that defines the model and behavior settings.
Authorization header value, typically a Bearer token for authentication.
Streaming Mode Requirements: If you enable
enableStreamingMode={true}
, your proxy endpoint must support Server-Sent Events (SSE). See the Streaming Mode guide for detailed implementation instructions.Testing Your Setup
Once you have the basic setup complete, you should see:- Chat interface rendered on your page
- Welcome message displayed in the chat
- Input field ready for user messages
- Send button to submit messages
Testing Streaming Mode
If you enabled streaming mode, you should see:- Characters appearing one by one as the AI responds
- No loading spinner during responses
- Real-time typing effect
Common Issues
Styles not loading correctly
Styles not loading correctly
Styles are now bundled with components. If you experience issues, check for CSS conflicts with your global styles.
API connection errors
API connection errors
The SDK connects to
https://dashboard.termix.ai
by default. Verify your authorization token is valid.Authentication failures
Authentication failures
Check that your
authorization
token is valid and properly formatted (usually Bearer your-token
).TypeScript errors
TypeScript errors
If using TypeScript, make sure you have the latest version of the library installed, which includes comprehensive type definitions.
Next Steps
Now that you have the basic setup working, you can:Explore Configuration
Learn about all available props and customization options
ChatWidget Component
Create floating chat widgets for customer support and help functionality
Streaming Mode
Enable real-time streaming responses with Server-Sent Events
Advanced Features
Set up function calling, smart contracts, and knowledge base integration
TypeScript Guide
Learn about type definitions and TypeScript-specific features