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-scalable-devtools/react-navigation-plugin

v0.0.5

Published

[한국어](README.ko.md)

Downloads

574

Readme

@react-native-scalable-devtools/react-navigation-plugin

한국어

This plugin exposes host-side endpoints that let an external agent read registered React Navigation state, navigate to a route, or go back in a running React Native app. It also patches the React Native debugger frontend with a Navigation tab that shows the registered navigation state live.

The plugin owns React Navigation ref registration. It does not inspect the UI tree or trigger view actions; use @react-native-scalable-devtools/element-inspector-plugin for observation and host-side automation tools when you need native taps or scrolls.

Usage

Register the plugin

const { startCommand } = require('@react-native-scalable-devtools/cli');
const {
  reactNavigationPlugin,
} = require('@react-native-scalable-devtools/react-navigation-plugin');

module.exports = {
  commands: [
    startCommand(reactNavigationPlugin()),
  ],
};

You can register it next to other plugins when an agent workflow needs both navigation-state inspection and UI actions:

const { startCommand } = require('@react-native-scalable-devtools/cli');
const {
  networkPanelPlugin,
  patchDebuggerFrontend: patchNetworkDebuggerFrontend,
} = require('@react-native-scalable-devtools/network-plugin');
const {
  elementInspectorPlugin,
} = require('@react-native-scalable-devtools/element-inspector-plugin');
const {
  reactNavigationPlugin,
} = require('@react-native-scalable-devtools/react-navigation-plugin');

module.exports = {
  commands: [
    startCommand(
      networkPanelPlugin({
        patchDebuggerFrontend: patchNetworkDebuggerFrontend,
      }),
      elementInspectorPlugin(),
      reactNavigationPlugin(),
    ),
  ],
};

Register a React Navigation ref

The plugin cannot discover your navigation container by itself. Create the navigation ref in the app and register it with the client entry.

import { createNavigationContainerRef } from '@react-navigation/native';
import { registerNavigationRef } from '@react-native-scalable-devtools/react-navigation-plugin/client';

export const navigationRef = createNavigationContainerRef();

if (__DEV__) {
  registerNavigationRef(navigationRef);
}
<NavigationContainer ref={navigationRef}>
  {/* screens */}
</NavigationContainer>

The plugin accepts any ref with the React Navigation-style methods it needs, so it does not import @react-navigation/native directly.

Debugger frontend tab

Registering reactNavigationPlugin() adds a Navigation tab to the React Native debugger frontend. The tab registers a custom ReactNavigation CDP domain and sends ReactNavigation.enable, ReactNavigation.getState, and ReactNavigation.disable through the existing debugger socket. The devtools server routes those commands to the app that is already bound to that debugger session, using the same app socket mapping as the network plugin.

When the tab is enabled, the app runtime listens to the registered navigation ref and emits ReactNavigation.stateUpdated whenever the navigation state changes. The panel renders the root history as a route list, expands nested navigator routes such as stacks, and opens a closable detail pane with name, key, and params when a route is selected. The event includes updatedAt and a state snapshot with isReady, sanitized root state, and currentRoute. A short polling fallback is used for navigation refs that do not expose a state listener.

Endpoints

Use GET /apps from the core package first when multiple apps are connected, then pass the selected appId.

curl -s "http://localhost:8081/apps"

Navigate

curl -s -X POST "http://localhost:8081/react-navigation/navigate" \
  -H "Content-Type: application/json" \
  -d '{"appId":"<appId>","name":"Settings","params":{"tab":"profile"}}'

The runtime calls the registered navigationRef.navigate(...). The request body can either pass name, params, key, path, and merge at the top level or inside a navigation object.

Go back

curl -s -X POST "http://localhost:8081/react-navigation/back" \
  -H "Content-Type: application/json" \
  -d '{"appId":"<appId>"}'

If the registered ref exposes canGoBack(), the plugin checks it before calling goBack().

Get navigation state

curl -s "http://localhost:8081/react-navigation/state?appId=<appId>"

The endpoint asks the app runtime for the registered React Navigation ref and returns a result whose value contains isReady, the sanitized root navigation state, and currentRoute. It does not add derived screen summaries; agents can read React Navigation's own index and routes structure from result.value.state.

Example response:

{
  "ok": true,
  "device": {
    "appId": "app-1",
    "name": "iPhone 15",
    "connected": true,
    "connectedAt": 1710000000000,
    "hasDebugger": true
  },
  "result": {
    "requestId": "req-1",
    "requestedAt": 1710000000100,
    "completedAt": 1710000000120,
    "action": "getNavigationState",
    "status": "ok",
    "value": {
      "isReady": true,
      "state": {
        "index": 1,
        "routeNames": ["Home", "Settings"],
        "routes": [
          { "key": "Home-a1", "name": "Home" },
          { "key": "Settings-b2", "name": "Settings" }
        ]
      },
      "currentRoute": {
        "key": "Settings-b2",
        "name": "Settings"
      }
    }
  }
}

Notes

This plugin is for development and agent automation workflows. It performs semantic JavaScript navigation through a registered React Navigation ref. It does not simulate native taps, gestures, or OS-level back behavior.

Use @react-native-scalable-devtools/element-inspector-plugin and host-side automation tools when an agent needs to inspect a React Native view and drive native taps or scrolls.