
Security News
MCP Community Begins Work on Official MCP Metaregistry
The MCP community is launching an official registry to standardize AI tool discovery and let agents dynamically find and install MCP servers.
webrtc-firebase
Advanced tools
wrapper over WebRTC with signaling based on firebase realtime database
wrapper over WebRTC with signaling based on firebase realtime database
To use this you need firebase api key, which you can get by creating a firebase project. here
This package currently supports data-channel for
which will look something like this
const firebaseConfig = {
apiKey: "***************************************",
authDomain: "<project-id>.firebaseapp.com",
projectId: "<project-id>",
storageBucket: "<project-id>.appspot.com",
messagingSenderId: "************",
appId: "<api-id>",
measurementId: "*-**********"
};
##API
##User Guide
Globally install documentation
using the npm package manager:
$ npm install -g webrtc-firebase
import wf from 'webrtc-firebase';
const firebaseConfig = {
apiKey: "***************************************",
authDomain: "<project-id>.firebaseapp.com",
projectId: "<project-id>",
storageBucket: "<project-id>.appspot.com",
messagingSenderId: "************",
appId: "<api-id>",
measurementId: "*-**********"
};
const channelName = ['channel1', 'channel2'];
let rtc;
const key = getURLParam('key');
if(key){
rtc = new wf.Guest(key, firebaseConfig, channelName ,onConnectionSuccess, onSessionStateChange );
}else{
const channelsConfig = [{name: 'channel1', type: 'data'}, {name: 'channel1', type: 'data'}];
// use RoomHost instead of Host here for a group communication
rtc = new wf.Host(firebaseConfig, channelsConfig , onKeyGenerated);
}
// on connection success to get data-channels use
const channel1 = rtc.getChannel('channel1');
--- utils.js
export const getURLParam = (param) => {
const queryString = window.location.search;
const urlParams = new URLSearchParams(queryString);
return urlParams.get(param)
}
export function insertParam(key, value) {
if (window.history.pushState) {
var newurl = window.location.protocol + "//" + window.location.host + window.location.pathname + `?${key}=${value}`;
window.history.pushState({ path: newurl }, '', newurl);
}
}
export const onKeyGenerated = (key) => {
insertParam('key', key);
});
export const onConnectionSuccess = () => {
console.log('connection successed');
}
this code generates a room url which u can share with whome you want to connect.
room host takes an other parameter, which we call ActivityManager, its like a server to this room and you can read or modify message before broadcasting them.
FAQs
wrapper over WebRTC with signaling based on firebase realtime database
The npm package webrtc-firebase receives a total of 17 weekly downloads. As such, webrtc-firebase popularity was classified as not popular.
We found that webrtc-firebase demonstrated a not healthy version release cadence and project activity because the last version was released a year ago. It has 2 open source maintainers collaborating on the project.
Did you know?
Socket for GitHub automatically highlights issues in each pull request and monitors the health of all your open source dependencies. Discover the contents of your packages and block harmful activity before you install or update your dependencies.
Security News
The MCP community is launching an official registry to standardize AI tool discovery and let agents dynamically find and install MCP servers.
Research
Security News
Socket uncovers an npm Trojan stealing crypto wallets and BullX credentials via obfuscated code and Telegram exfiltration.
Research
Security News
Malicious npm packages posing as developer tools target macOS Cursor IDE users, stealing credentials and modifying files to gain persistent backdoor access.