Zephyr Metro Plugin

1.0.2 · active · verified Tue Apr 21

zephyr-metro-plugin is a Metro bundler plugin designed to integrate React Native applications with Zephyr Cloud for advanced deployment features. It enables Over-the-Air (OTA) updates, supports Module Federation for dynamic code loading, and streamlines the overall deployment process for iOS and Android applications. Currently stable at version 1.0.2, the package maintains an active development status with a consistent release cadence, featuring frequent patch updates that address dependency management and minor bug fixes. It serves as a critical bridge for React Native developers aiming to leverage Zephyr Cloud's capabilities, distinguishing itself by offering comprehensive deployment and update management directly within the Metro bundling workflow, which is particularly beneficial for large-scale or continuously evolving mobile applications.

Common errors

Warnings

Install

Imports

Quickstart

This quickstart demonstrates how to integrate `zephyr-metro-plugin` into your `metro.config.ts` or `metro.config.js` file, enabling Zephyr Cloud features. It wraps your existing Metro configuration with `withZephyr` and requires environment variables for authentication.

import { getDefaultConfig } from 'expo/metro-config'; // Or 'metro-config' if not using Expo
import withZephyr from 'zephyr-metro-plugin';
import path from 'path';

const projectRoot = __dirname;
const config = getDefaultConfig(projectRoot);

// Ensure required environment variables are set for Zephyr Cloud
const zephyrAppId = process.env.ZEPHYR_APP_ID ?? '';
const zephyrApiKey = process.env.ZEPHYR_API_KEY ?? '';

if (!zephyrAppId || !zephyrApiKey) {
  console.warn('ZEPHYR_APP_ID and ZEPHYR_API_KEY environment variables are required for Zephyr Cloud integration.');
}

module.exports = withZephyr(config, {
  zephyrAppId: zephyrAppId,
  zephyrApiKey: zephyrApiKey,
  // Optional: Define custom Zephyr options
  // moduleFederation: {
  //   shared: ['react', 'react-native'],
  // },
  // ota: {
  //   enabled: true,
  //   channel: 'production',
  // },
});

view raw JSON →