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

ermis-rn-webrtc

v1.0.8

Published

A call SDK designed for React Native applications, providing functionalities for managing audio and video calls.

Downloads

19

Readme

ErmisChat Call SDK for React native

Platform Languages npm

Overview

The ermis-rn-webrtc SDK provides a robust solution for integrating real-time voice and video calling capabilities into your React Native applications. Built on WebRTC technology, this SDK simplifies the process of managing calls, handling signaling, and managing media streams.

Note: This SDK is designed exclusively for React Native applications and cannot be used with regular web applications.

Features

  • Create and manage voice and video calls
  • Handle incoming and outgoing call events
  • Manage audio and video streams with ease
  • Support for data channels for real-time messaging
  • Network health monitoring and connection stability features
  • Call upgrade capability (audio to video)

Installation

To install the ermis-rn-webrtc SDK, run the following command:

npm install ermis-rn-webrtc react-native-webrtc

or

yarn add ermis-rn-webrtc react-native-webrtc

Prerequisites

  • Setup ermis-chat-js-sdk
  • Before using the call SDK, you must initialize and set up the chat SDK, as the call functionality relies on the chat client for signaling:
import { ErmisChat } from 'ermis-chat-js-sdk';

// Initialize chat client
const chatClient = ErmisChat.getInstance(API_KEY, PROJECT_ID, {
  timeout: 6000,
  baseURL: API_URL,
});

// Connect user to chat
await chatClient.connectUser(
  {
    api_key: API_KEY,
    id: USER_ID,
    name: USER_ID,
    image: '',
  },
  `Bearer ${YOUR_TOKEN}`
);

Usage

Importing the SDK

Importing the SDK to use the SDK in your application, import it as follows:

import { ErmisDirectCallNative } from 'ermis-rn-webrtc';

// Initialize call client
const callClient = new ErmisDirectCallNative(chatClient, sessionId);

The sessionId parameter required when initializing the call client is a unique identifier that:

  • Should be generated as a random UUID when the user first logs in
  • Must be stored and reused for subsequent sessions for the same user
  • Should be unique per device and user
  • Is used to maintain call state across reconnections

Example of generating a sessionId:

import { v4 as uuidv4 } from 'uuid';

// Generate on first login and store it
const SESSION_ID = uuidv4(); // e.g. '8cf60120-6e05-46d4-b913-ef69670b8dd7'

Creating a Call

You can create a call by using the createCall method:

await callClient.createCall(callType, cid);

Initiates a new call.

  • callType: Either 'audio' or 'video'
  • cid: Channel ID for the call

Accepting a Call

To accept an incoming call, use the acceptCall method:

await callClient.acceptCall();

Ending a Call

To end an ongoing call, call the endCall method:

await callClient.endCall();

Reject a Call

To reject an ongoing call, call the rejectCall method:

await callClient.rejectCall();

Upgrade a Call

To upgrade an audio call to a video call, call the upgradeCall method:

await callClient.upgradeCall();

Toggle Mic

Enables or disables the microphone, call the toggleMic method:

callClient.toggleMic(true); // Enable microphone
callClient.toggleMic(false); // Disable microphone

Toggle Camera

Enables or disables the camera, call the toggleCamera method:

callClient.toggleCamera(true); // Enable microphone
callClient.toggleCamera(false); // Disable microphone

Callback Functions

onCallEvent

Triggered when a call event occurs (incoming or outgoing).

callClient.onCallEvent = data => {
  console.log(`Call type: ${data.type}`); // 'incoming' or 'outgoing'
  console.log(`Call mode: ${data.callType}`); // 'audio' or 'video'
};

onLocalStream

Triggered when the local video stream is ready.

callClient.onLocalStream = stream => {
  // Handle local stream, e.g., display in <RTCView>
};

onRemoteStream

Triggered when the remote video stream is received.

callClient.onRemoteStream = stream => {
  // Handle local stream, e.g., display in <RTCView>
};

onConnectionMessageChange

Triggered when the connection status message changes.

callClient.onConnectionMessageChange = message => {
  // Handle connection messages (e.g., "Your network connection is unstable")
};

onCallStatus

Triggered when the call status changes.

callClient.onCallStatus = status => {
  // Handle call status updates (RINGING, CONNECTED, ENDED)
};

onDataChannelMessage

Triggered when a message is received through the WebRTC data channel.

callClient.onDataChannelMessage = data => {
  // Handle data channel messages
};

onUpgradeCall

Triggered when a call is upgraded from audio to video.

callClient.onUpgradeCall = upgraderInfo => {
  // Handle call upgrade
};

onError

Triggered when an error occurs during the call.

callClient.onError = error => {
  // Handle error
};

Example Application

An example application demonstrating the usage of the React Native Call SDK can be found in the example directory. To run the example application, navigate to the example folder and follow the instructions in the README.md file located there.

Contributing

Contributions are welcome! Please feel free to submit a pull request or open an issue for any enhancements or bug fixes.

License

This project is licensed under the MIT License. See the LICENSE file for details.

Contact

For any inquiries or support, please reach out to the maintainers of this SDK.