0.0.7 • Published 4 years ago

@sirusdev/p2pchat-browser-sdk v0.0.7

Weekly downloads
-
License
GPL-3.0
Repository
-
Last release
4 years ago

P2PChat Browser SDK

libarry to develop peer-to-peer chat cliet on browser

Quick Start

you should have signalling service installed on your system before use this library, signalling service is necessary to create rooms and manage access to those rooms.

  1. install this library via NPM repositry

    npm install p2pchat-browser-sdk
  2. simple client usage

    import {} from 'p2pchat-browser-sdk'
    
    const client = createNewClient({
      signalingUrl: 'https://my-signalling-service.com',
      logLevel: 'info',
    });
    
    // get token from signaling service. then you can connect as user
    await client.login('token-from-signalling');
    await client.connect();
    
    // send message to a rooms
    await client.sendMessage('room-id', {
      type: MessageType.MESSAGE,
      content: 'hello!'
    });
0.0.7

4 years ago

0.0.6

4 years ago

0.0.5

4 years ago

0.0.4

4 years ago

0.0.3

4 years ago

0.0.2

4 years ago

0.0.1

4 years ago