# 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

```jsx

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';
