simple-chat-widget

1.0.32 • Public • Published

Simple Chat Widget

Widget to display chat between attendees.

Simple Chat Widget config

** apiBaseUrl = base url for API

** streamApiKey = getstream.io API key

** forumSlug = getstream.io forum slug

accessToken = user access token

onAuthError(err, res) = method called upon api 401 or 403 error

openDir = direction to where the chat opens, right or left, default left

title = widget title

showHelp = shows Help channel, default false

showQA = shows QA channel, default false

hideUsers = hides the User list, default false

START A ONE TO ONE CHAT FROM OUTSIDE

const WidgetContainer = () => {
    const childRef = useRef();
    const startOneToOneChat = () => {
        childRef.current.startOneToOneChat('PARTNER USER ID')
    }
    
    return (
        <div style={{width: '350px', margin: '20px auto', backgroundColor: 'lightgray', height: 500}}>
            <SimpleChatWidget {...widgetProps} ref={childRef} />
            <button onClick={startOneToOneChat}>Start One To One Chat</button>
        </div>
    )
}

PUBLISH TO NPM:

  1. npm version patch / npm version minor / npm version major

  2. npm run publish-package

IMPORT:

import SimpleChatWidget from 'simple-chat-widget';

import 'simple-chat-widget/index.css';

Readme

Keywords

none

Package Sidebar

Install

npm i simple-chat-widget

Weekly Downloads

16

Version

1.0.32

License

Apache-2.0

Unpacked Size

84.6 kB

Total Files

5

Last publish

Collaborators

  • spalenque
  • romanetar
  • tomrndom