npm package discovery and stats viewer.

Discover Tips

  • General search

    [free text search, go nuts!]

  • Package details

    pkg:[package-name]

  • User packages

    @[username]

Sponsor

Optimize Toolset

I’ve always been into building performant and accessible sites, but lately I’ve been taking it extremely seriously. So much so that I’ve been building a tool to help me optimize and monitor the sites that I build to make sure that I’m making an attempt to offer the best experience to those who visit them. If you’re into performant, accessible and SEO friendly sites, you might like it too! You can check it out at Optimize Toolset.

About

Hi, 👋, I’m Ryan Hefner  and I built this site for me, and you! The goal of this site was to provide an easy way for me to check the stats on my npm packages, both for prioritizing issues and updates, and to give me a little kick in the pants to keep up on stuff.

As I was building it, I realized that I was actually using the tool to build the tool, and figured I might as well put this out there and hopefully others will find it to be a fast and useful way to search and browse npm packages as I have.

If you’re interested in other things I’m working on, follow me on Twitter or check out the open source projects I’ve been publishing on GitHub.

I am also working on a Twitter bot for this site to tweet the most popular, newest, random packages from npm. Please follow that account now and it will start sending out packages soon–ish.

Open Software & Tools

This site wouldn’t be possible without the immense generosity and tireless efforts from the people who make contributions to the world and share their work via open source initiatives. Thank you 🙏

© 2026 – Pkg Stats / Ryan Hefner

@xcall/web

v1.1.0

Published

xCall SDK — embed video calls in any website

Readme

@xcall/web

Embed video calls in any website with a single JavaScript class.

Installation

npm install @xcall/web

How it works

  1. Your backend generates a JWT token using the xCall API
  2. You pass that token to the SDK
  3. The SDK mounts a secure video call inside any HTML element

The token carries all configuration: room, user, branding, permissions. Your secret keys never reach the frontend.


Usage

React

import { useEffect, useRef } from "react";
import { XCall } from "@xcall/sdk";

export function VideoCall({ token }: { token: string }) {
  const containerRef = useRef<HTMLDivElement>(null);

  useEffect(() => {
    if (!containerRef.current) return;

    const call = new XCall({
      container: containerRef.current,
      token,
    });

    call.on("joined", ({ roomId }) => console.log("joined", roomId));
    call.on("left", ({ roomId }) => console.log("left", roomId));
    call.on("error", ({ message }) => console.error(message));

    return () => call.destroy();
  }, [token]);

  return <div ref={containerRef} style={{ width: "100%", height: "600px" }} />;
}

Vue

<template>
  <div ref="callContainer" style="width:100%;height:600px" />
</template>

<script setup>
import { XCall } from "@xcall/sdk";
import { ref, onMounted, onUnmounted } from "vue";

const props = defineProps(["token"]);
const callContainer = ref(null);
let call;

onMounted(() => {
  call = new XCall({ container: callContainer.value, token: props.token });
  call.on("left", () => console.log("left"));
});

onUnmounted(() => call?.destroy());
</script>

Angular

import {
  Component,
  ElementRef,
  ViewChild,
  Input,
  OnDestroy,
  AfterViewInit,
} from "@angular/core";
import { XCall } from "@xcall/sdk";

@Component({
  selector: "app-call",
  template: '<div #container style="width:100%;height:600px"></div>',
})
export class CallComponent implements AfterViewInit, OnDestroy {
  @ViewChild("container") container!: ElementRef;
  @Input() token!: string;
  private call!: XCall;

  ngAfterViewInit() {
    this.call = new XCall({
      container: this.container.nativeElement,
      token: this.token,
    });
    this.call.on("left", () => console.log("left"));
  }

  ngOnDestroy() {
    this.call?.destroy();
  }
}

HTML / CDN

<div id="call" style="width:100%;height:600px"></div>

<script src="https://cdn.jsdelivr.net/npm/@xcall/sdk/dist/xcall.min.js"></script>
<script>
  const call = new XCallSDK.XCall({
    container: "#call",
    token: "YOUR_TOKEN_HERE",
  });

  call.on("left", () => console.log("left"));
</script>

API

new XCall(options)

| Option | Type | Required | Description | | ------------- | ----------------------- | -------- | ------------------------------------------------------------ | | container | HTMLElement \| string | ✅ | Element or CSS selector where the call will mount | | token | string | ✅ | JWT token generated by your backend | | roomUrl | string | — | Custom xCall-room URL (default: https://room.xcall.com.br) | | iframeStyle | object | — | Extra CSS styles applied to the iframe |


Events

call.on('ready',             ()                                    => void)
call.on('joined',            ({ roomId, userId })                  => void)
call.on('left',              ({ roomId, reason? })                 => void)
call.on('participant_joined',({ userId, displayName? })            => void)
call.on('participant_left',  ({ userId })                          => void)
call.on('error',             ({ code, message })                   => void)

Methods

call.muteAudio(true); // mute / unmute microphone
call.muteVideo(false); // mute / unmute camera
call.leave(); // end the call programmatically
call.destroy(); // remove iframe and listeners (use on component unmount)

Token generation

Tokens must be generated server-side. Never expose your API secret on the frontend.

// Example: Node.js backend
const res = await fetch("https://api.xcall.com.br/session", {
  method: "POST",
  headers: { "x-api-key": process.env.XCALL_SECRET },
  body: JSON.stringify({ room: "my-room", user: { display_name: "John" } }),
});
const { token } = await res.json();

License

MIT