Podchatweb is a web app built by react for handling POD chating use cases
npm install podchatweb --save
git clone https://github.com/FanapSoft/pod-chat-react-module.git
npm install
git clone https://github.com/FanapSoft/pod-chat-ui-kit.git
npm install
__ |_ pod-chat-react-module |_ pod-chat-ui-kit
npm run start
React component:
import {PodchatJSX} from "podchatweb";
class MyApp extends Component {
render() {
const {token} = this.props;
return <PodchatJSX token={token}/>
}
}
import {Podchat} from "podchatweb"
class MyApp extends Component {
componentDidMount() {
const {token} = this.props;
Podchat({token}, "myChat")
}
render() {
return <div id="myChat"/>
}
}
<!DOCTYPE html>
<html lang="en">
<head>
<meta charset="utf-8">
<meta name="viewport" content="width=device-width, initial-scale=1">
<script src="dist/index.js"/>
</head>
<body>
<div id="app"></div>
<script>
var podchat = Podchat({token: "YOUR_TOKEN"}, "app");
//GOT NEW TOKEN
podchat.setToken("YOUR_NEW_TOKEN");
</script>
</body>
</html>
You can use podchatweb as support mode module with this simple config.
import {PodchatJSX} from "podchatweb";
class MyApp extends Component {
render() {
const {token} = this.props;
return <PodchatJSX supportMode={8543}
token={token}/>
}
}
Prop | Usage | Type |
---|---|---|
supportMode | Mentioned earlier | Boolean |
small | Look like loading podchatweb on mobile device | Boolean |
disableNotification | No notification | Boolean |
routerLess | No changes on browser route by chat | Boolean |
onRetryHook | While retrying for a new connection if you set this prop chat will call your function and wait for a Promise return. Resolve that promise with a fresh token | Func |
onSignOutHook | Click on sign out button and this props will make you a decision maker to what to do after that. | Func |
onTypingHook | While typing in a thread you will get the content | Func |
onNotificationClickHook | You can make yourself notify when a user click on a browser default notification that generated by chat. | Func |
This project is open-sourced software licensed under the MIT license.