Podchatweb is a web app built by react for handling POD chating use cases
npm run start
npm install podchatweb --save
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>
}
}
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>
This project is open-sourced software licensed under the MIT license.