Podchatweb
Podchatweb is a web app built by react for handling POD chating use cases
Development
npm run start
Installation
npm install podchatweb --save
Usage
React component:
import {PodchatReact} from "podchatweb"
class MyApp extends Component {
render() {
const {token} = this.props;
return
<div>
<PodchatReact token={token} onTokenExpire={callBack => {callBack(token)}}/>
</div>
}
}
Programmatic calling:
Module loader:
import {Podchat} from "podchatweb"
class MyApp extends Component {
componentDidMount() {
const {token} = this.props;
Podchat({token}, "myChat")
}
render() {
return <div id="myChat"/>
}
}
Old school:
<!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>
License
This project is open-sourced software licensed under the MIT license.