Clio SDK for React Native
npm install clio-react-native
or
yarn add clio-react-native
import * as React from 'react';
import { StyleSheet, View, Button } from 'react-native';
import { ChatModal } from 'clio-react-native';
export default function App() {
//const { presentChat } = useClio();
const [chatVisible, setVisible] = React.useState(false);
function openChat() {
setVisible(true);
}
function closeChat() {
setVisible(false);
}
return (
<View style={styles.container}>
<Button title="Open Chat" onPress={openChat}>
Open Chat
</Button>
<ChatModal
visible={chatVisible}
accountToken="accountToken1"
clientId="clientId1"
closeChat={closeChat}
host="<youraccount>.askclio.ai"
companyName="<youraccount>"
/>
</View>
);
}
const styles = StyleSheet.create({
container: {
flex: 1,
alignItems: 'center',
justifyContent: 'center',
},
box: {
width: 60,
height: 60,
marginVertical: 20,
},
});
See the contributing guide to learn how to contribute to the repository and the development workflow.
MIT