agent-ai-react-client
React Chat Client for agent.ai
Bootstrapped with create-react-library
Install
yarn add agent-ai-react-client
or
npm install --save agent-ai-react-client
Note the peer dependencies of the library are React 15 or 16, and RxJS 6
Usage
import React Component from 'react'; import Chat from 'agent-ai-react-client'; // Init configuration data (see below)const cfg = apiServer: 'https://URL:PORT(optional)' zenKey: '' tags: department: 'Itenerary Support' { const visitor = display_name: 'ben d' email: 'customer@gmail.com' phone: '5202297592' return <Chat = />; }
Configuration
The configuration object passed as the config
prop of AgentChat
contains the following keys (defined in src/chat/ConfigShape.js
):
apiServer
(string): The base URI of the agent.ai API server, e.g.https://api.agent.ai
Development
Initial setup: run yarn
in both agent-ai-react-client
folder and agent-ai-react-client/example
folder.
To run, open to consoles, one for each bath above, and run yarn start
in each.
You can no develop the control and view it through the example app.
License
MIT © usercare