0.1.3 • Published 4 months ago

@clio-ai/clio-react-native v0.1.3

Weekly downloads
-
License
MIT
Repository
github
Last release
4 months ago

clio-react-native

Clio SDK for React Native

Installation

npm install clio-react-native

or

yarn add clio-react-native

Usage

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"
      />
    </View>
  );
}

const styles = StyleSheet.create({
  container: {
    flex: 1,
    alignItems: 'center',
    justifyContent: 'center',
  },
  box: {
    width: 60,
    height: 60,
    marginVertical: 20,
  },
});

Contributing

See the contributing guide to learn how to contribute to the repository and the development workflow.

License

MIT

0.1.3

4 months ago

0.1.2

5 months ago

0.1.1

5 months ago

0.1.0

5 months ago