React Native SDK

SmartlyChat SDK – React Native Integration

Easily integrate your Smartly AI chatbot into any mobile app.

SmartlyChat SDK is the fastest way to bring a conversational experience to your mobile users—on both iOS and Android. Whether you're building a support assistant, onboarding bot, or product recommender, SmartlyChat makes it easy to plug your chatbot into your React Native app with just a few lines of code.

🧩 Why Use SmartlyChat?

  • No chatbot experience required
  • Ready-to-use chat UI
  • Customizable to match your app’s branding
  • Real-time communication with Smartly AI bots
  • Easy to install and use

🚀 Quick Start

1. Install the SDK

Run this command in your React Native project:

npm install smartlychat-sdk

Make sure your project includes react, react-native, and expo.


2. Basic Usage

Here’s how to embed your bot in an app:

import { SmartlyChat } from 'smartlychat-sdk';

export default function App() {
  return (
    <SmartlyChat
      botID="YOUR_BOT_ID"
      lang="en"
      userID="USER_ID"
    />
  );
}

That’s it! You now have a working chat interface connected to your Smartly AI bot.


⚙️ Props Reference

PropTypeRequiredDescription
botIDstringYour Smartly AI bot ID
langstringLanguage code (e.g., 'en', 'fr')
userIDstringA unique user identifier
containerStyleStyleProp<ViewStyle>Customize chat container layout
tabStyleStyleProp<ViewStyle>Style for the chat tab (if used)
chatbotButtonStyleStyleProp<ViewStyle>Style the floating chatbot button
chatbotTextStyleStyleProp<TextStyle>Style the button label text
messageContainerStyleStyleProp<ViewStyle>Style for individual messages
messageTextStyleStyleProp<TextStyle>Style the message text
inputStyleStyleProp<ViewStyle>Style the input box
sendButtonStyleStyleProp<ViewStyle>Style for the send button
sendButtonTextStyleStyleProp<TextStyle>Text style for send button
avatarStyleStyleProp<ImageStyle>Avatar image customization
sourcesButtonStyleStyleProp<ViewStyle>Customize the “Sources” button
sourcesTextStyleStyleProp<TextStyle>Style for source list text

🧪 Example with Custom Styles

<SmartlyChat
  botID="demo-bot"
  lang="en"
  userID="user-123"
  chatbotButtonStyle={{ backgroundColor: '#007AFF' }}
  chatbotTextStyle={{ color: 'white' }}
/>

🧠 How It Works

  • The chat component opens a real-time socket connection to the Smartly AI backend.
  • Messages sent by the user are passed directly to the bot.
  • Bot responses appear in the chat, optionally with citable sources shown in a modal.
  • The widget handles all messaging logic and formatting—just pass in your botID.

Some screenshots




🎨 Customization

You can override the styling of every UI element using standard React Native styles. This lets you make the chatbot feel native to your app.


📦 Dependencies

This package requires:

  • react
  • react-native
  • expo
  • react-native-render-html
  • socket.io-client

All are peer dependencies and should be installed alongside smartlychat-sdk.


🛠 Developer Info

  • Fully written in TypeScript
  • Main entry: dist/index.js
  • Types: dist/index.d.ts

📁 Repository

Find the full source code and example apps here:
GitHub Repository