space-chat
Made with create-react-library
Install
npm install --save space-chat
or
yarn add space-chat
Usage
Creating or finding a channel by unique name
import { Chat } from 'space-chat'
function App() {
return (
<div>
<Chat
provider='twilio'
token='user-token'
identity='jon-doe'
channelName='unique-channel-name'
onReady={() => console.log('Chat is ready')}
onError={(error) => console.log('Chat error', error)}
/>
</div>
)
}
export default App
Finding a channel by Sid
import { Chat } from 'space-chat'
function App() {
return (
<div>
<Chat
provider='twilio'
token='user-token'
identity='jon-doe'
channelSid='CH164f325e19364483a3d5531581afb990'
onReady={() => console.log('Chat is ready')}
onError={(error) => console.log('Chat error', error)}
/>
</div>
)
}
export default App
License
MIT © Joyjet