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

connle-video-sdk

v0.1.5

Published

Connle voice and video SDK

Readme

ConnleVideo SDK Developer Guide

Installation

Install ConnleVideo via NPM:

npm install connle-video-sdk

Or use your preferred package manager, such as:

yarn add connle-video-sdk

Import and Initialization

In your JavaScript/TypeScript file:

import ConnleVideo from 'connle-video-sdk';

const serverUrl = 'https://your-server.com';
const token = 'YOUR_JWT_TOKEN';
const mediaUrl = 'https://your-media-url'; // Optional. Uses default if not provided.

// Create an instance of ConnleVideo
const connleai = new ConnleVideo(serverUrl, token, mediaUrl);

// Establish the connection
connleai.connect();

Event-Based Callbacks

1. connleai.onConnect(callback)

Fires after a successful connection.

connleai.onConnect((data) => {
  console.log('Connected:', data);
});

2. connleai.onDisconnect(callback)

Triggered on disconnection.

connleai.onDisconnect((data) => {
  console.log('Disconnected:', data);
});

3. connleai.onIncomingCall(callback)

Fires when another user initiates a call.

connleai.onIncomingCall((data) => {
  console.log('Incoming call:', data);
});

4. connleai.onAnswered(callback)

Triggered when the call is answered.

connleai.onAnswered((data) => {
  console.log('Call answered:', data);
});

5. connleai.onEnded(callback)

Fires when the call ends.

connleai.onEnded((data) => {
  console.log('Call ended:', data);
});

6. connleai.onMessage(callback)

Fires when a chat or custom message is received.

connleai.onMessage((data) => {
  console.log('Received message:', data);
});

7. connleai.onStatus(callback)

Handles general status updates.

connleai.onStatus((data) => {
  console.log('Status update:', data);
});

8. connleai.onError(callback)

Triggered on error events.

connleai.onError((error) => {
  console.error('ConnleVideo error:', error);
});

Making and Receiving Calls

Make a Call

connleai.call('bob123', { audio: true, video: true }, (ack) => {
  console.log('Call initiated:', ack);
});

Handle Incoming Calls

connleai.onIncomingCall((callData) => {
  connleai.answer((ack) => {
    console.log('Call answered:', ack);
  });
});

Reject or Hangup

connleai.reject(callData.call_id, (ack) => {
  console.log('Call rejected:', ack);
});

connleai.hangup();

Managing Audio and Video

// Microphone control
connleai.mute();
connleai.unmute();
connleai.toggleAudio();

// Camera control
connleai.pause();
connleai.play();
connleai.toggleVideo();

Screen Sharing

connleai.shareScreen();
connleai.stopScreenShare();
connleai.toggleScreenShare();

Messaging (Optional)

Send a Message

connleai.sendMessage({ text: 'Hello world' }, (ack) => {
  console.log('Message sent:', ack);
});

Receive a Message

connleai.onMessage((data) => {
  console.log('Received message:', data);
});

Core Events

connleai.on('eventName', (data) => {
  console.log('Received event:', data);
});

| Event Name | Description | |---------------------------|----------------------------------------------| | connected | Session successfully connected. | | disconnected | Session disconnected. | | userConnected | Remote user joined the call. | | userDisconnected | Remote user left the call. | | muted / unmuted | Microphone muted or unmuted. | | paused / play | Video paused or resumed. | | mediaStarted / mediaStopped | Media stream started or stopped. | | streamAdded / streamRemoved | Remote media track added/removed. | | localStreamAdded / localStreamRemoved | Local track added or removed. | | error | Error encountered (permissions, etc.). |


Minimal Example

import ConnleVideo from 'connle-video-sdk';

function initCall() {
  const connleai = new ConnleVideo(
    'https://your-server.com',
    'YOUR_JWT_TOKEN',
    'https://your-media-url'
  );

  connleai.connect();

  connleai.onIncomingCall((callData) => {
    connleai.answer();
  });

  document.getElementById('callBtn').onclick = () => {
    connleai.call('anotherUser', { audio: true, video: true }, (ack) => {
      console.log('Call started:', ack);
    });
  };

  document.getElementById('hangupBtn').onclick = () => {
    connleai.hangup();
  };

  connleai.on('error', (err) => {
    console.error('ConnleAI Error:', err);
  });
}

initCall();

Final Notes

  • Permissions: Ensure camera/mic access is granted.
  • Screen Sharing: Users must approve screen capture requests.
  • Autoplay: Some browsers require user interaction before audio/video playback begins.
  • Token Expiry: Always use fresh tokens if you experience reconnection issues.