space-chat
TypeScript icon, indicating that this package has built-in type declarations

1.0.9 • Public • Published

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

Readme

Keywords

none

Package Sidebar

Install

npm i space-chat

Weekly Downloads

1

Version

1.0.9

License

MIT

Unpacked Size

211 kB

Total Files

23

Last publish

Collaborators

  • joyjet