agent-ai-react-client

1.0.9 • Public • Published

agent-ai-react-client

React Chat Client for agent.ai

NPM JavaScript Style Guide

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'
}
 
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

Readme

Keywords

none

Package Sidebar

Install

npm i agent-ai-react-client

Weekly Downloads

8

Version

1.0.9

License

LGPL-3.0-only

Unpacked Size

378 kB

Total Files

8

Last publish

Collaborators

  • joshwhite