1.0.9 • Published 7 years ago
agent-ai-react-client v1.0.9
agent-ai-react-client
React Chat Client for agent.ai
Bootstrapped with create-react-library
Install
yarn add agent-ai-react-clientor
npm install --save agent-ai-react-clientNote 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'
}
class Example extends Component {
render() {
const visitor = {
display_name: 'ben d',
email: 'customer@gmail.com',
phone: '5202297592'
}
return <Chat config={cfg} />;
}
}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