react-native-chat360-sdk
v0.4.0
Published
chat360-sdk
Downloads
19
Maintainers
Readme
React Native Chat360 SDK
React Native SDK converted from the iOS Chat360 SDK. Provides both embeddable bot view and full-screen modal bot.
Installation
npm install react-native-chat360-sdk react-native-webviewUsage
Modal Chat360Bot (Recommended)
import React from 'react';
import { Chat360BotProvider, openChat360Bot } from 'react-native-chat360-sdk';
export default function App() {
return (
<Chat360BotProvider
modalProps={{ animationType: 'fade' }}
header={<CustomHeader />}
closeButton={<CustomCloseIcon />}
containerStyle={{ backgroundColor: 'white' }}
>
<Home />
</Chat360BotProvider>
);
}
// Open Chat360Bot anywhere with configuration
openChat360Bot({
botConfig: {
botId: 'BOT',
appId: 'APP',
meta: { userId: '123' },
useNewUI: true
},
onPresented: () => console.log('Chat360Bot opened')
});Chat360Bot Screen Component
import React from 'react';
import { Chat360BotScreen } from 'react-native-chat360-sdk';
export default function MyScreen() {
return (
<Chat360BotScreen
botConfig={{
botId: 'BOT',
appId: 'APP',
meta: { userId: '123' },
useNewUI: true
}}
containerStyle={{ margin: 8 }}
onMessage={(data) => console.log('Message:', data)}
/>
);
}Configuration Options
Chat360Bot Configuration:
botId- Your Chat360 bot IDappId- Your Chat360 app ID (You can send you app name in it)meta- Additional metadata objectbaseUrl- Custom base URLuseNewUI- Enable new UI experiment (defaults tofalse)
Contributing
See the contributing guide to learn how to contribute to the repository and the development workflow.
License
MIT
