Local package / monorepo (Metro)
The package ships TypeScript source, so Metro compiles it directly — no build step. When you install it from a local path (portal:, file:, link:) or a monorepo, Metro must watch the real package folder, resolve peers from your app's node_modules, and ignore the package's own node_modules (otherwise two copies of React / React Native load):
// metro.config.js (host app)const fs = require('fs');const path = require('path');const {getDefaultConfig, mergeConfig} = require('@react-native/metro-config'); const appNodeModules = path.resolve(__dirname, 'node_modules');const linked = path.resolve(appNodeModules, '@realtimexsco/live-chat-react-native');const chatPkg = fs.existsSync(linked) ? fs.realpathSync(linked) : linked; module.exports = mergeConfig(getDefaultConfig(__dirname), { watchFolders: [chatPkg], resolver: { nodeModulesPaths: [appNodeModules], extraNodeModules: {'@realtimexsco/live-chat-react-native': chatPkg}, blockList: [new RegExp(`${chatPkg.replace(/[/\\]/g, '[/\\\\]')}/node_modules/.*`)], },});Fieldr's metro.config.js adds three things for its own dependencies: VideoSDK modules mapped to the app's copies in extraNodeModules + a resolveRequest that resolves them from the app, unstable_conditionNames: ['react-native', 'require'], and CommonJS aliases for axios, redux-saga and react-native-screens.
Keep transformer.allowOptionalDependencies enabled (the default in @react-native/metro-config) so the optional native peers can be missing.
After native changes in the package (Android library, iOS pod), rebuild the app (pod install, Gradle) — a Metro reload is not enough.