1.0.9 • Published 6 years ago

agent-ai-react-client v1.0.9

Weekly downloads
3
License
LGPL-3.0-only
Repository
github
Last release
6 years ago

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

1.0.9

6 years ago

1.0.8

6 years ago

1.0.6

6 years ago

1.0.5

6 years ago

1.0.4

6 years ago

1.0.3

6 years ago

1.0.2

6 years ago

1.0.1

6 years ago