Security News
pnpm 10.0.0 Blocks Lifecycle Scripts by Default
pnpm 10 blocks lifecycle scripts by default to improve security, addressing supply chain attack risks but sparking debate over compatibility and workflow changes.
@proofmeid/webrtc-web
Advanced tools
This package allows easy usage of the WebRTC part as of a lot of utilty functions to check credentials and validity of those
Import the package
import { WebRtcProvider } from "@proofmeid/webrtc-web";
Inject it inside the constructor
constructor(
private webRtcProvider: WebRtcProvider
) {
And... ready to use!
Call the method 'launchWebsocketClient' to launch a websocket to receive messages on.
this.webRtcProvider.launchWebsocketClient({
signalingUrl: environment.signalingUrl,
isHost: true
});
And that's all. The library handles all of the difficult WebRTC parts
There are several observables to listen on, one of them is the 'uuid'. It is the channel on which this host will receive connections to. To make it easily accesible, set the uuid in a QR so the client can scan it. In this example we use the 'qrcode' library which is publicly available on npm (https://www.npmjs.com/package/qrcode)
this.webRtcProvider.uuid$.subscribe((uuid: string) => {
const canvas = this.qrCodeCanvas.nativeElement as HTMLCanvasElement;
QRCode.toCanvas(canvas, `p2p:${uuid}`, {
width: 250,
errorCorrectionLevel: "high",
});
});
Now this makes the QR code available for the client to scan, when the client (Mobile Proofme App) scans the QR code, it will connect automatically, the websocket connection gets closed and the P2P connection is being setup. Now we can do all sorts of communications.
Receive actions (messages send by client) through this observable
this.webRtcProvider.receivedActions$.subscribe
Listen to a close event (when client disconnects) on the connection through this oberservable
this.webRtcProvider.websocketConnectionClosed$.subscribe
There are several actions available (login, identify are the most commonly used)
const timestamp = new Date();
const requestedData: IRequestedCredentials = {
by: "Proofme",
description: "full identification",
credentials: [
{ key: "PHOTO", provider: "EPASS", required: true },
{ key: "FIRST_NAME", provider: "EPASS", required: true },
{ key: "LAST_NAME", provider: "EPASS", required: true },
{ key: "BIRTH_DATE", provider: "EPASS", required: true },
{ key: "GENDER", provider: "EPASS", required: true },
{ key: "NATIONALITY", provider: "EPASS", required: true },
{ key: "DOCUMENT_NUMBER", provider: "EPASS", required: true },
{ key: "DOCUMENT_EXPIRY_DATE", provider: "EPASS", required: true },
{ key: "DOCUMENT_TYPE", provider: "EPASS", required: true }
]
};
this.webRtcProvider.sendData("identify", {
request: requestedData,
timestamp
});
This will send a request to the Proofme App to share certain credentials
FAQs
WebRTC + Signaling Server
The npm package @proofmeid/webrtc-web receives a total of 72 weekly downloads. As such, @proofmeid/webrtc-web popularity was classified as not popular.
We found that @proofmeid/webrtc-web demonstrated a healthy version release cadence and project activity because the last version was released less than 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
pnpm 10 blocks lifecycle scripts by default to improve security, addressing supply chain attack risks but sparking debate over compatibility and workflow changes.
Product
Socket now supports uv.lock files to ensure consistent, secure dependency resolution for Python projects and enhance supply chain security.
Research
Security News
Socket researchers have discovered multiple malicious npm packages targeting Solana private keys, abusing Gmail to exfiltrate the data and drain Solana wallets.