Plugin Development
This guide will walk you through the complete process of creating a React Native DevTools plugin, from initial generation to building for production.
Tip: Before creating your own plugin, check out the Official Plugins to see if there's already a plugin that meets your needs!
Quick Start
Generate a new plugin in seconds:
Step 1: Generate Your Plugin
The rozenite generate command creates a complete plugin project structure:
This creates:
- Complete TypeScript project setup
- Vite build configuration with Rozenite plugin
- Sample DevTools panel
- Git repository with initial commit
- All dependencies installed
Step 2: Understanding Plugin Structure
Your generated plugin has this structure:
Step 3: Creating Panels
Panels are React components that appear in the DevTools interface. They're defined in your rozenite.config.ts file. Plugin developers can leverage React Native APIs and libraries to create powerful debugging tools that integrate deeply with the React Native runtime.
Type-Safe Plugin Development
Rozenite provides full TypeScript support for plugin development. The RozeniteDevToolsClient uses an event-based API with full type safety:
Client API
Type Safety Benefits
- Compile-time error checking for event names and payloads
- IntelliSense support for all event types and methods
- Type-safe event handling between DevTools and React Native
- Automatic refactoring when event interfaces change
- Plugin ID isolation ensures events don't conflict between plugins
Panel Configuration Options
Creating a Panel Component
Create a new panel by adding a React component:
Using the Plugin Bridge
Connect your panel to React Native using the plugin bridge. The RozeniteDevToolsClient provides full TypeScript support for type-safe communication:
Step 4: React Native Integration
Add React Native functionality by creating a react-native.ts file. You can use React Native APIs and libraries to enhance your plugin:
Step 5: Local Development Workflow
Complete Development Setup
For local plugin development, follow these steps:
Step 1: Create and Start Your Plugin
This starts a development server that:
- Watches for file changes
- Hot reloads your panels automatically
- Opens the Rozenite dev host in your browser (see below)
- Provides real-time feedback during development
Step 2: Develop panels in the browser (no playground app)
rozenite dev uses @rozenite/vite-plugin to serve a dev host at the root of the dev server (by default http://localhost:8888/). You can iterate on DevTools panels without running a separate playground app:
- Panel preview — Every entry in
rozenite.config.tsappears as a tab. The selected panel loads inside an iframe, similar to how it is embedded in React Native DevTools. - Message log — Outbound messages from your panel (the same
rozenite-messageenvelope the plugin bridge uses when talking to the parent) are listed with timestamps so you can see what the panel emitted. - Dispatch message — Send a command
typeand JSONpayloadinto the iframe as if DevTools had sent it. The host fills inpluginIdfrom your packagenameinpackage.json. That value must match thepluginIdyou pass touseRozeniteDevToolsClient/getRozeniteDevToolsClient; otherwise your handlers will not run.
The dev server port is aligned with Rozenite runtime dev mode: when you set ROZENITE_DEV_MODE to your plugin package name, the app loads the plugin from http://localhost:8888, so one rozenite dev process can serve both the in-browser host and the in-app plugin bundle.
Use this flow for rapid UI work and bridge message shapes. To exercise react-native.ts and native integration, continue with a real app (next steps).
Step 3: Link to a React Native app (optional, for native side)
- Create or use a React Native project that has Rozenite configured (for example the repository playground app).
- Add your plugin to the app's dependencies (you can use
npm link,yarn link, orpnpm linkfor local development).
Step 4: Run your React Native app
Then run the app on your device or simulator.
Step 5: Open DevTools
- Open React Native DevTools in your browser
- Your plugin panels should appear in the sidebar automatically
Hot Reloading
Your development workflow supports automatic hot reloading:
- Panel changes: Your DevTools panels will automatically update when you make changes to your plugin code
- React Native integration changes: Changes to your
react-native.tsfile will also hot reload - New panels: If you add a new panel to your
rozenite.config.ts, restart React Native DevTools by pressingCtrl+R(orCmd+Ron Mac) - Configuration changes: Most changes to
rozenite.config.tsrequire a DevTools restart
Testing Your Plugin
- Make changes to your panel components - they should update instantly
- Modify your React Native integration code - changes should be reflected immediately
- Add new panels - remember to restart DevTools with
Ctrl+R - Test communication between your panels and React Native code
Step 6: Building for Production
Build your plugin for distribution:
This creates optimized bundles:
- DevTools panels (minified and optimized)
- React Native entry point (if
react-native.tsexists) - Ready for distribution
Build Output
The build creates a dist/ directory with:
*.js- Individual DevTools panel files (one file per panel, names reflect your config)react-native.js- React Native integration (if applicable)rozenite.json- Plugin manifest with metadata and configuration- Source maps for debugging
Next Steps
- Check out Official Plugins to see available plugins
- Join the community to share your plugins and get help
