Catalog npm
Back to packageRELEASE DETAILS

1.0.15

npm

6buns-client

Client Library for 6buns

Published15 Apr 2022
Direct dependencies21
Transitive dependenciesNot calculated

README

Current package documentation

web-client

Installation

  • Using npm,
npm i 6buns-client
  • Using CDN,
<script src="https://unpkg.com/6buns@1.0.0"></script>

Usage

You create bun object, which handles all the webrtc things for you,

const options = {
  accountSid: "",
  apiKey: "",
  maxParticipants: "",
};

const bun = new Bun(options);

Join a room, by providing an id, and password key if required.

bun.join({
  roomId: "abcdef",
  roomPass: 45678,
});

Add Media, like microphone, or webcam, or screen

bun.setMedia({
	video: false, // camera or screen share
	audio: true,
	screen: true,
})

Stop live stream of your webcam, or other user's webcam.

bun.stop({
	mediaType: '',
	peerId: ''
})

Whenever a new user joins, new-peer event is fired, which can be handled on frontend.

bun.on("new-peer", (event) => {
  // Do something whenever a new user joins.
});

Whenever a new media track is available, new-remote-track event is fired. This event is usually fired when a user in room switched on/off their webcam/mic/screenshare

bun.on("new-remote-track", (event) => {
  // Add remote user's track
});

Whenever a user leaves, peer-left event is fired.

bun.on("peer-left", (id) => {
	// Do something when user leaves
});

Process for WEBRTC Peer to Peer

INITIATOR

  • Get User Media
  • Add Stream
  • Create Offer
  • Set Local SDP, Send Offer
  • On Answer
  • Set Remote Description
  • Send Candidates
  • Add Candidates

PARTICIPANT

  • Get User Media
  • Add Stream
  • On Offer
  • Set Remote Description
  • Create Answer
  • Set Local Description, Send Answer
  • Add Ice Candidates
  • Send Ice Candidates

Downloads & popularity

Awaiting observations

No metric observations yet

Download counts and popularity will appear here as the collector receives them.

Declared dependencies 21

Native requirements
21 direct targetsNot calculated transitive count
Package / targetRequirementRelationship
events
Environment
{
  "local_name": "events",
  "alias": false,
  "peer_metadata": null
}
^3.3.0runtime
socket.io-client
Environment
{
  "local_name": "socket.io-client",
  "alias": false,
  "peer_metadata": null
}
^4.4.1runtime
@babel/core
Environment
{
  "local_name": "@babel/core",
  "alias": false,
  "peer_metadata": null
}
^7.17.5development
@babel/preset-env
Environment
{
  "local_name": "@babel/preset-env",
  "alias": false,
  "peer_metadata": null
}
^7.16.11development
@babel/preset-typescript
Environment
{
  "local_name": "@babel/preset-typescript",
  "alias": false,
  "peer_metadata": null
}
^7.16.7development
@rollup/plugin-babel
Environment
{
  "local_name": "@rollup/plugin-babel",
  "alias": false,
  "peer_metadata": null
}
^5.3.1development
@rollup/plugin-commonjs
Environment
{
  "local_name": "@rollup/plugin-commonjs",
  "alias": false,
  "peer_metadata": null
}
^21.0.2development
@rollup/plugin-node-resolve
Environment
{
  "local_name": "@rollup/plugin-node-resolve",
  "alias": false,
  "peer_metadata": null
}
^13.1.3development
@rollup/plugin-typescript
Environment
{
  "local_name": "@rollup/plugin-typescript",
  "alias": false,
  "peer_metadata": null
}
^8.3.1development
@types/debug
Environment
{
  "local_name": "@types/debug",
  "alias": false,
  "peer_metadata": null
}
^4.1.7development
@types/jsonwebtoken
Environment
{
  "local_name": "@types/jsonwebtoken",
  "alias": false,
  "peer_metadata": null
}
^8.5.8development
babel
Environment
{
  "local_name": "babel",
  "alias": false,
  "peer_metadata": null
}
^6.23.0development
core-js
Environment
{
  "local_name": "core-js",
  "alias": false,
  "peer_metadata": null
}
^3.21.1development
debug
Environment
{
  "local_name": "debug",
  "alias": false,
  "peer_metadata": null
}
^4.3.3development
jsdoc
Environment
{
  "local_name": "jsdoc",
  "alias": false,
  "peer_metadata": null
}
^3.6.10development
regenerator-runtime
Environment
{
  "local_name": "regenerator-runtime",
  "alias": false,
  "peer_metadata": null
}
^0.13.9development
rollup
Environment
{
  "local_name": "rollup",
  "alias": false,
  "peer_metadata": null
}
^2.68.0development
rollup-plugin-node-builtins
Environment
{
  "local_name": "rollup-plugin-node-builtins",
  "alias": false,
  "peer_metadata": null
}
^2.1.2development
rollup-plugin-node-globals
Environment
{
  "local_name": "rollup-plugin-node-globals",
  "alias": false,
  "peer_metadata": null
}
^1.4.0development
rollup-plugin-terser
Environment
{
  "local_name": "rollup-plugin-terser",
  "alias": false,
  "peer_metadata": null
}
^7.0.2development
tslib
Environment
{
  "local_name": "tslib",
  "alias": false,
  "peer_metadata": null
}
^2.3.1development

Distribution files

1 collected
Distribution 1

Source distribution

Source file
Checksums from source
{
  "integrity": "sha512-zUhgojSNDo6dl2zRdnvHOsMmMN2G45Z0oGJ2dHU/UfSo0Fgq0Xq+00T7l+e2mDjQkeAgKAObeQS0oxPAYfQSPQ==",
  "shasum": "4d4b7a449d062abfd2f2f757b767cd7e03bc2042",
  "tarball": "https://registry.npmjs.org/6buns-client/-/6buns-client-1.0.15.tgz",
  "fileCount": 14,
  "unpackedSize": 328091,
  "signatures": [
    {
      "keyid": "SHA256:jl3bwswu80PjjokCgh0o2w5c2U4LhQAE57gj9cz1kzA",
      "sig": "MEQCIF93DXM/GKI1MizqIKbtKosvu9q62F2tcyp959yYUluxAiBkjJUQLhreaUxE6PJgDAgcQnV057eDSmGsyY6fuH/N9g=="
    }
  ],
  "npm-signature": "-----BEGIN PGP SIGNATURE-----\r\nVersion: OpenPGP.js v4.10.10\r\nComment: https://openpgpjs.org\r\n\r\nwsFzBAEBCAAGBQJiWLy4ACEJED1NWxICdlZqFiEECWMYAoorWMhJKdjhPU1b\r\nEgJ2Vmq9jQ/7B9GAQ8a5J82YBRl7e5Hyg57/FJYfX2AGhaTrjCi1JWl7sk4T\r\nB+KE4wh24X1tfQ+b1wi+UA9ok/YA9XskCfi/gyzXBr2qov/37rF4ZeW6mD0S\r\nj10CqMKFR45GxXNZKSN1T+Ba0vTum7isS/Cpt2w0zrDddfJolhdwHruMxQBG\r\nWwc0N0tvfFqeuvPXavTVI1CbJDZIvV2+x52PvrgDZJfRaemhjnIn9B3dBCjO\r\nrVyESrVsvdameVa67JKV8pjw087UkqVS4tObvyhj3M+Fo1sF9Cghoovtc6iN\r\nN8w05vtYtWUAF3ihwgIFG8pqgdH4KN8F5wBlp6xutwdvm8LR4H2eesBE6gAX\r\n/k7hZJ56/vSgjlOBixMNcXRSGizgoGxDgZUObLajeu0+Jvp/PujRpN8pdjzM\r\nqSA1p0+WGgclHrDjdJrJIcU3FgqWomR2FFSzqSgEnjbvDHdMAPGpT/7Q07xW\r\nIbRE1LOsITvW8N5Z1g8JQVLVK4JmMxZAowGjEgl1wVmkLrb57db6aujF58qp\r\n7sgf0aqQniPBRWy9+5c8gYId+3H37yTUsjmG4i50lgLNHJ3gPY2QGytzzlhI\r\nog9mDapKZQd6XKpOOQzXCwperye/oj1V+xcFRCcZyKdMvUqHfRadCv1QAxFo\r\n2/ozGn3eIejpKPHUQOaZH29c3TLioi/aiIc=\r\n=4KB7\r\n-----END PGP SIGNATURE-----\r\n"
}

Metadata history

Meaningful changes
Current collected state Current

Observed since 20 Oct, 20:50 UTC

No superseded metadata states collected. Unchanged observations do not create new revisions.

Record identity

package_version:98e015ff6001efab3862fcfd2ffa8fcfcecbe891ae9fa955bc5899db66f19e45

Other collected versions

1.0.2419 Apr1.0.2318 Apr1.0.2218 Apr1.0.2116 Apr1.0.2016 Apr1.0.1916 AprView all collected versions →