@sirusdev/p2pchat-browser-sdk
TypeScript icon, indicating that this package has built-in type declarations

0.0.7 • Public • Published

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!'
    });

Readme

Keywords

Package Sidebar

Install

npm i @sirusdev/p2pchat-browser-sdk

Weekly Downloads

0

Version

0.0.7

License

GPL-3.0

Unpacked Size

540 kB

Total Files

28

Last publish

Collaborators

  • rahmat.sirus
  • rizkirachyan
  • hasan-sirus