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

@bits-innovate/react-native-vstarcam

v1.0.23

Published

React Native bridge for VStarCam P2P SDK

Downloads

2,883

Readme

react-native-vstarcam

React Native bridge for VStarCam P2P SDK - enables direct communication with VStarCam cameras for WiFi configuration, video streaming, PTZ control, and more.

Features

  • ✅ P2P Connection to VStarCam cameras
  • ✅ WiFi configuration
  • ✅ WiFi network scanning
  • ✅ PTZ control (pan, tilt, zoom)
  • ✅ Video streaming
  • ✅ Snapshot capture
  • ✅ Two-way audio (planned)

Installation

npm install react-native-vstarcam
# or
yarn add react-native-vstarcam

Expo Users

This package requires native code and won't work with Expo Go. You need to use a development build:

npx expo prebuild
npx expo run:android
# or
npx expo run:ios

Android Setup

The package automatically links the VStarCam AAR library. No additional setup required.

iOS Setup

  1. Run pod install in your iOS directory
  2. The VStarCam iOS framework needs to be placed in ios/Frameworks/

Usage

import { createVStarCamClient, ConnectionState } from "react-native-vstarcam";

// Create a client
const client = createVStarCamClient();

// Connect to camera
async function connectToCamera(deviceId: string) {
  // Create client with device ID
  await client.create(deviceId);

  // Connect via P2P
  const result = await client.connect(true);

  if (result.state === ConnectionState.ONLINE) {
    console.log("Connected!");

    // Login
    await client.login("admin", "888888");

    // Get device info
    const info = await client.getDeviceInfo();
    console.log("Device:", info);
  }
}

// Configure WiFi
async function configureWiFi() {
  // Scan for networks
  const networks = await client.scanWiFi();
  console.log("Available networks:", networks);

  // Configure WiFi
  const success = await client.configureWiFi("MyWiFi", "MyPassword", "WPA2", 6);

  if (success) {
    console.log("WiFi configured successfully!");
  }
}

// PTZ Control
async function moveCameraUp() {
  await client.ptzUp(true); // Continuous movement
  await new Promise((resolve) => setTimeout(resolve, 1000));
  await client.ptzStop();
}

// Cleanup
async function disconnect() {
  await client.disconnect();
  await client.destroy();
}

API Reference

VStarCamClient

Methods

| Method | Description | | ----------------------------------------------- | -------------------------------- | | create(deviceId) | Create a P2P client for a device | | connect(lanScan?, serverParam?, connectType?) | Connect to camera | | login(username?, password?) | Login to camera | | disconnect() | Disconnect from camera | | destroy() | Cleanup and release resources |

WiFi Methods

| Method | Description | | ---------------------------------------------------- | -------------------------------- | | scanWiFi() | Scan for available WiFi networks | | configureWiFi(ssid, password, security?, channel?) | Configure camera WiFi |

PTZ Methods

| Method | Description | | ----------------------- | -------------------- | | ptzUp(continuous?) | Move camera up | | ptzDown(continuous?) | Move camera down | | ptzLeft(continuous?) | Move camera left | | ptzRight(continuous?) | Move camera right | | ptzStop() | Stop camera movement |

Video Methods

| Method | Description | | ------------------------- | ------------------ | | startVideo(streamType?) | Start video stream | | stopVideo() | Stop video stream | | takeSnapshot() | Capture a snapshot |

Enums

enum ConnectionState {
  INVALID_CLIENT,
  CONNECTING,
  INITIALIZING,
  ONLINE,
  CONNECT_FAILED,
  DISCONNECTED,
  INVALID_ID,
  OFFLINE,
  TIMEOUT,
  MAX_SESSION,
  MAX,
  REMOVE_CLOSE,
}

enum ConnectionMode {
  NONE,
  P2P,
  RELAY,
  SOCKET,
}

Events

// Connection state changes
client.addConnectionListener((clientId, state) => {
  console.log("Connection state:", ConnectionState[state]);
});

// Command responses
client.addCommandListener((clientId, command, data) => {
  console.log("Command:", command, "Data:", data);
});

// Video frames
client.addVideoListener((clientId, frame, width, height, timestamp) => {
  // Handle video frame
});

VStarCam Device ID

The Device ID (DID) is typically printed on the camera or shown in the VStarCam app. Format: VSTA-XXXXXX-XXXXX

Troubleshooting

Connection fails

  1. Ensure the camera is powered on and in pairing mode
  2. Check that your phone is on the same network
  3. Verify the Device ID is correct

WiFi configuration fails

  1. Ensure you're connected to the camera first
  2. Check WiFi password is correct
  3. Make sure the network is 2.4GHz (most VStarCam cameras don't support 5GHz)

License

MIT