1.0.0 • Published 3 years ago

joyjet-space-chat v1.0.0

Weekly downloads
-
License
MIT
Repository
-
Last release
3 years ago

space-chat

Made with create-react-library

NPM JavaScript Style Guide

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