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

@capybara-devtools/react-native

v0.8.0

Published

React Native SDK for Capybara: logs, network and storage for React Native and Expo apps

Downloads

1,056

Readme

@capybara-devtools/react-native

React Native SDK for Capybara: sends your app's logs, network requests (including WebSockets), storage and state to the Capybara UI on your computer, and lets you edit AsyncStorage and MMKV values from it.

On React Native 0.85 or later, Capybara reads logs, network and storage through Metro without this package, except in Expo Go on Android, whose JavaScript engine cannot be debugged. Add it to see storage changes as they happen, to see state, in Expo Go on Android, or on older React Native versions.

npm install @capybara-devtools/react-native

Call init() in a file of its own, and import that file on the first line of your entry file:

// capybara.ts
import AsyncStorage from '@react-native-async-storage/async-storage';
import { asyncStorage, init, mmkvStorage } from '@capybara-devtools/react-native';
import { storage } from './storage'; // your react-native-mmkv instance

if (__DEV__) init({ appName: 'My app', storage: [asyncStorage(AsyncStorage), mmkvStorage(storage)] });
// index.ts
import './capybara';
import { registerRootComponent } from 'expo';
import App from './App';

registerRootComponent(App);

Called in index.ts itself, init() would run too late: a file's imports all run before its own code, so your other modules, and the stores they create, would load first.

Then run npx capybara-devtools (or open the desktop app) on the computer running Metro. The SDK finds it from the bundle URL, so simulators and phones on the same Wi-Fi connect without configuration. If Capybara runs on another port (--port, or CAPYBARA_PORT), pass the same port to init(). enabled: false makes init() do nothing, to turn it off at run time. In a release build (__DEV__ false) init() does nothing, even without the if, unless you pass allowProduction: true, for example in an internal test build. Keep the if anyway, so the SDK is never set up for your users.

State

The State tab shows Redux, Zustand, XState, MobX, TanStack Query, SWR and React Context. init() picks up Redux Toolkit's configureStore(), zustand stores made with devtools() and React Context providers on its own, as long as it runs before your store modules load. With Expo Router, that means an entry file of your own ("main": "index.ts") that imports the file calling init(), then expo-router/entry. The rest take one line each:

import { swrMiddleware, watchMobX, watchQueryClient, watchXState, watchZustand } from '@capybara-devtools/react-native';
import * as mobx from 'mobx';

if (__DEV__) {
  watchZustand(useCounterStore, { name: 'counter' }); // a store without devtools()
  watchXState(checkoutActor); // from createActor(machine)
  watchMobX(cartStore, mobx, { name: 'cart' });
  watchQueryClient(queryClient);
}

// SWR's cache here comes from the provider; the middleware watches it and runs the State tab's buttons.
<SWRConfig value={{ provider: () => new Map(), use: __DEV__ ? [swrMiddleware] : [] }}>
  <App />
</SWRConfig>

That cache shows as cache #1. To name it, make the provider with swrProvider as well, next to use: [swrMiddleware]: provider: swrProvider(() => new Map(), { name: 'api' }).

Redux stores that init() cannot see take capybaraReduxEnhancer() or connectReduxStore(store), and zustand devtools() stores made before it take watchZustand(), without action names. Give your contexts a displayName, or they take the name of the component that renders their provider. init() also turns zustand's devtools() on, which then builds a stack trace for every set without an action name and, on Hermes, still shows it as anonymous: name the actions, set anonymousActionType in the devtools() options, or pass init({ state: { redux: false } }) and use watchZustand and capybaraReduxEnhancer() instead. init({ state: false }) turns state off; the README has the other options and the limits.

Documentation: github.com/lhphuc99/capybara