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

schoolx-ota-manager

v1.0.8

Published

React Native library for managing OTA updates with GitLab integration

Downloads

42

Readme

React Native OTA Manager

A React Native library for managing Over-The-Air (OTA) updates with GitLab integration. This library provides automatic version checking, bundle downloading, and installation for React Native apps.

Features

  • GitLab Integration: Direct integration with GitLab repositories
  • Version Compatibility: Smart version checking with range operators (>, >=, <, <=, =)
  • Build Number Tracking: Automatic build number management
  • Platform Support: iOS and Android support
  • Auto Update: Configurable automatic update checking
  • Progress Tracking: Real-time update progress callbacks
  • No UI: Pure logic component, integrate with your own UI

Installation

npm install schoolx-ota-manager
# or
yarn add schoolx-ota-manager

Dependencies

Make sure you have these dependencies installed:

npm install react-native-device-info react-native-ota-hot-update react-native-fs @react-native-async-storage/async-storage axios

Note: isomorphic-git is NOT required for this library since we download bundles directly via GitLab API, not using Git clone/pull operations.

Quick Start

1. Basic Usage with Component

import React, { useRef } from "react";
import { OTAUpdate } from "schoolx-ota-manager";

const App = () => {
  const otaRef = useRef();

  const handleProgress = (progress) => {
    console.log("Update progress:", progress.status, progress.message);
  };

  const handleUpdateAvailable = (hasUpdate) => {
    if (hasUpdate) {
      console.log("Update available!");
      // Trigger update installation
      otaRef.current?.installUpdate();
    }
  };

  return (
    <>
      <OTAUpdate
        ref={otaRef}
        gitlabToken="your-gitlab-token"
        gitlabProjectId="your-project-id"
        gitlabBaseUrl="https://gitlab.com/api/v4"
        repoFolder="schoolx-parent"
        onProgress={handleProgress}
        onUpdateAvailable={handleUpdateAvailable}
      />
      {/* Your app content */}
    </>
  );
};

2. Advanced Usage with OtaManager

import React, { useEffect } from 'react';
import { OtaManager } from 'schoolx-ota-manager';

const App = () => {
  useEffect(() => {
    const otaManager = new OtaManager({
      gitlabToken: 'your-gitlab-token',
      gitlabProjectId: 'your-project-id',
      gitlabBaseUrl: 'https://gitlab.com/api/v4',
      repoFolder: 'schoolx-parent',
      platform: 'ios', // or 'android'
      autoUpdate: false,
      checkInterval: 300000
    });

    // Set progress callback
    otaManager.onProgress((progress) => {
      console.log('Progress:', progress);
    });

    // Start auto checking
    otaManager.startAutoCheck();

    // Manual check
    otaManager.checkUpdate().then(updateInfo => {
      if (updateInfo.hasUpdate) {
        otaManager.installUpdate();
      }
    });

    return () => {
      otaManager.stopAutoCheck();
    };
  }, []);

  return (
    // Your app content
  );
};

Configuration

OtaConfig

interface OtaConfig {
  gitlabToken: string; // GitLab private token
  gitlabProjectId: string; // GitLab project ID
  gitlabBaseUrl: string; // GitLab API base URL
  repoFolder: string; // Repository folder name
  platform: "ios" | "android"; // Target platform
  autoUpdate?: boolean; // Auto install updates
}

Version Format

The version field in your version.json supports range operators:

{
  "ios": {
    "version": ">=1.0.0", // App version >= 1.0.0
    "buildNumber": 20241215001,
    "bundleType": "bytecode",
    "commitId": "main",
    "bundlePath": "ios/main.ios.hbc.jsbundle",
    "isForced": false,
    "releaseNotes": "Bug fixes and performance improvements"
  }
}

Supported operators: >, >=, <, <=, = (or no operator for exact match)

API Reference

OTAUpdate Component

Props

  • gitlabToken: GitLab private token
  • gitlabProjectId: GitLab project ID
  • gitlabBaseUrl: GitLab API base URL
  • repoFolder: Repository folder name
  • onProgress: Progress callback
  • onUpdateAvailable: Update availability callback
  • onUpdateCompleted: Update completion callback

Ref Methods

  • checkUpdate(): Check for updates
  • installUpdate(): Install available update
  • checkAndInstallUpdate(): Check and install if available
  • checkOnAppStart(): Check for updates when app starts
  • getInstalledBuildNumber(): Get current build number

OtaManager Class

Methods

  • checkUpdate(): Check for updates
  • installUpdate(): Download and install update
  • checkAndInstallUpdate(): Check and install if available
  • checkOnAppStart(): Check for updates when app starts
  • onProgress(callback): Set progress callback

File Structure

Your GitLab repository should have this structure:

your-repo/
├── version.json
├── ios/
│   └── hermes.ios.hbc.zip
└── android/
    └── hermes.android.hbc.zip

Example version.json

{
  "android": {
    "version": ">=1.0.0",
    "buildNumber": 20241215001,
    "bundleType": "bytecode",
    "commitId": "main",
    "bundlePath": "android/index.android.hbc.bundle",
    "isForced": false,
    "releaseNotes": "Bug fixes and performance improvements"
  },
  "ios": {
    "version": ">=1.0.0",
    "buildNumber": 20241215001,
    "bundleType": "bytecode",
    "commitId": "main",
    "bundlePath": "ios/main.ios.hbc.jsbundle",
    "isForced": false,
    "releaseNotes": "Bug fixes and performance improvements"
  }
}

License

MIT