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

react-native-zephyr-sdk

v0.0.7

Published

A React Native SDK for managing remote app versions and updates using the Zephyr platform. This SDK provides version checking, remote app resolution, and storage management for micro-frontends in React Native applications.

Readme

React Native Zephyr SDK

A React Native SDK for managing remote app versions and updates using the Zephyr platform. This SDK provides version checking, remote app resolution, and storage management for micro-frontends in React Native applications.

Info: To use this SDK, you must use zephyr-repack-plugin in your host application. This SDK is designed to work with Zephyr Cloud's deployment plugin, which injects necessary configuration at build time.

Installation

npm install react-native-zephyr-sdk@latest

Dependencies

This SDK requires the following peer dependencies:

npm install react-native-mmkv@>=3.1.0
npm install react@>=19.0.0
npm install react-native@>=0.78.0

Quick Start

⚙️ Configuration (Custom Storage)

Use this approach when you need to share storage with Repack or customize storage settings:

import {
  ReactNativeZephyrSDK,
  createMmkvInstance,
} from 'react-native-zephyr-sdk';

// For sharing storage with Repack
const sdk = new ReactNativeZephyrSDK({
  storageInstanceName: 'shared-with-repack',
});

// Or with custom MMKV instance
const customStorage = createMmkvInstance('my-custom-storage');
const sdk = new ReactNativeZephyrSDK({
  storage: customStorage,
});

API Reference

Remote App Management

import { zephyrSDK as zeSDK } from '../zephyr.ts';
s;

// Get single remote app information
const result = await zeSDK.getRemoteApp('RemoteAppName');

// Check all remote apps for updates
const allUpdates = await checkAllRemoteUpdates();
if (allUpdates.isUpdated) {
  console.log('Updates available for:', allUpdates.results);
}

// Get current remote URL
const currentUrl = await getCurrentRemoteUrl('RemoteAppName');

Polling Control

// Configure polling interval
zeSDK.setUpdateConfig({ pollingInterval: 30000 });

// Start polling
zeSDK.startPolling(30000); // or startPolling() if interval already set

// Check polling status
if (zeSDK.isPolling()) {
  console.log('Polling is active');
}

// Stop polling
zeSDK.stopPolling();

Information & Debugging

// Get specific remote app info
const remoteInfo = zeSDK.getCurrentRemoteInfo('MyRemoteApp');
console.log(remoteInfo);

// Debug configuration
const values = zeSDK.verifyValues();

🔧 Class API (Advanced Usage)

For advanced scenarios like custom storage or Repack integration:

import { ReactNativeZephyrSDK } from 'react-native-zephyr-sdk';

const sdk = new ReactNativeZephyrSDK({
  storageInstanceName: 'custom-storage', // Optional
  enableDebug: true, // Optional
});

// All the same methods available
const result = await sdk.getRemoteApp('RemoteAppName');
sdk.setPollingInterval(30000);
sdk.startPolling();

📱 React Component Examples

Simple Update Check Component

import React, { useEffect, useState } from 'react';
import { View, Text, Button, Alert } from 'react-native';
import { getRemoteApp, startPolling, stopPolling } from 'react-native-zephyr-sdk';

const UpdateChecker = ({ remoteName = 'MyRemoteApp' }) => {
  const [updateAvailable, setUpdateAvailable] = useState(false);
  const [isPolling, setIsPolling] = useState(false);

  const checkForUpdates = async () => {
    try {
      const result = await getRemoteApp(remoteName);
      setUpdateAvailable(result.isUpdated);

      if (result.isUpdated) {
        Alert.alert(
          'Update Available',
          `New version available for ${remoteName}`,
          [
            { text: 'Later', style: 'cancel' },
            { text: 'Update', onPress: handleUpdate }
          ]
        );
      }
    } catch (error) {
      console.error('Update check failed:', error);
    }
  };

  const handleUpdate = () => {
    // Implement your update logic here
    console.log('Applying update...');
     init({
        name: hostAppName,
        remotes: [{name: remoteAppName, entry: results.availableRemoteUrl}],
      });
  };

  const togglePolling = () => {
    if (isPolling) {
      stopPolling();
    } else {
      startPolling(30000); // Poll every 30 seconds
    }
    setIsPolling(!isPolling);
  };

  useEffect(() => {
    checkForUpdates();
  }, []);

  return (
    <View style={{ padding: 20 }}>
      <Text>Remote App: {remoteName}</Text>
      <Text>Update Available: {updateAvailable ? 'Yes' : 'No'}</Text>

      <Button title="Check for Updates" onPress={checkForUpdates} />
      <Button
        title={isPolling ? 'Stop Auto-Check' : 'Start Auto-Check'}
        onPress={togglePolling}
      />

      {updateAvailable && (
        <Button title="Apply Update" onPress={handleUpdate} />
      )}
    </View>
  );
};

📋 Version Resolution

The SDK supports various version resolution formats in your zephyr:dependencies:

{
  "zephyr:dependencies": {
    "remoteApp1": "^1.0.0",
    "remoteApp2": "workspace:*",
    "remoteApp3": "zephyr:remote_app_uid@latest",
    "remoteApp4": "@app-zephyr/[email protected]"
  }
}
  • Semver: "^1.0.0" - Standard semantic versioning
  • Workspace: "workspace:*" - Same repository/branch/user conditions
  • Zephyr Registry: "zephyr:app_uid@tag" - Specific app UID with tag
  • Scoped: "@org/app@version" - Scoped package naming