React Native SDK

Easily integrate Chat360 chatbots into your React Native applications with the react-native-chat360-sdk. This library provides a straightforward way to launch and interact with Chat360 bots, offering customizable metadata support for tailored experiences.


Installation:

  • Install the Package
  • Add the Chat360 SDK to your project:
  • npm install react-native-chat360-sdk
  • or

  • yarn add react-native-chat360-sdk
  • This SDK is tested for React Native versions: 0.76.0 onwards.


Android Permissions

  • Conditional Permission:
  • Record Audio:
  • If you want to use the Speech-to-Text feature, please add the following permissions to your AndroidManifest.xml file:

                            
    <uses-permission android:name="android.permission.RECORD_AUDIO" />
    <uses-permission android:name="android.permission.MODIFY_AUDIO_SETTINGS" />
                            
                          

  • Location:
  • If your bot requires location permissions, please add the following permissions to your AndroidManifest.xml file:

                            
    <uses-permission android:name="android.permission.ACCESS_FINE_LOCATION" />
    <uses-permission android:name="android.permission.ACCESS_COARSE_LOCATION" />
                            
                          

Usage

  • Launching a Chatbot
  • Below is a basic example of how to use the SDK:

                    
        import { startChatBot } from 'react-native-chat360-sdk';
                userId: '12345',
                const metadata = {
                language: 'en',
                sessionId: 'abcde12345',
                };

                startChatBot({
        botId: 'your-bot-id', // Replace with your Chat360 bot ID
                metadata,
                });

                            
                          

  • Steps to Get Started
    • Replace 'your-bot-id' with the unique ID of your Chat360 bot.
    • Define the metadata object with relevant details, such as userId, sessionId, and any other context-specific data.
    • Invoke the startChatBot function with your bot ID and metadata to launch the chatbot.