├── docs
├── installation.md
├── tools
│ ├── network.md
│ ├── storage.md
│ ├── routes.md
│ ├── react-query.md
│ └── env.md
├── config.json
├── quick-start.md
├── floating-devtools.md
├── custom-tools.md
└── overview.md
├── LICENSE
└── README.md
/docs/installation.md:
--------------------------------------------------------------------------------
1 | ---
2 | title: Installation
3 | id: installation
4 | ---
5 |
6 | Get Buoy running in your React Native app in minutes.
7 |
8 | ## Requirements
9 |
10 |
11 |
12 | ## Quick Start
13 |
14 | Install the core package and any tools you need:
15 |
16 |
17 |
18 | ## Available Packages
19 |
20 | Each package adds a new tool to your floating menu. Install only what you need.
21 |
22 |
23 |
24 | ## TypeScript Support
25 |
26 | All packages include TypeScript definitions out of the box. No additional `@types` packages needed.
27 |
28 | ## Next Steps
29 |
30 | - [Quick Start](./quick-start) — Basic setup guide
31 | - [FloatingDevTools](./floating-devtools) — Configuration options
32 | - [Custom Tools](./custom-tools) — Build your own debugging tools
33 |
--------------------------------------------------------------------------------
/docs/tools/network.md:
--------------------------------------------------------------------------------
1 | ---
2 | title: Network Monitor
3 | id: tools-network
4 | ---
5 |
6 | See every API call your app makes. Request, response, headers, timing, errors — all in real-time with zero configuration.
7 |
8 | ## Supported Clients
9 |
10 |
11 |
12 | > **GraphQL gets special treatment** — Operation names are extracted from queries, mutations, and subscriptions, then displayed with variables using arrow notation: `GetUser › 123`. No more guessing which `/graphql` request is which.
13 |
14 | ---
15 |
16 | ## Installation
17 |
18 |
19 |
20 | That's it. The Network Monitor auto-detects and appears in your FloatingDevTools menu.
21 |
22 | ---
23 |
24 | ## What You See
25 |
26 | For every request:
27 |
28 |
29 |
30 | ---
31 |
32 | ## Status Colors
33 |
34 |
35 |
36 | ---
37 |
38 | ## What's Next
39 |
40 | - [Storage Inspector](./storage) — Browse and edit AsyncStorage & MMKV
41 | - [Environment Inspector](./env) — Validate env vars with type checking
42 | - [React Query](./react-query) — Inspect query cache and simulate states
43 |
--------------------------------------------------------------------------------
/docs/tools/storage.md:
--------------------------------------------------------------------------------
1 | ---
2 | title: Storage Explorer
3 | id: tools-storage
4 | ---
5 |
6 | Browse, edit, and manage all your app's persisted data. See every key-value pair across all storage backends in real-time.
7 |
8 | ## Supported Backends
9 |
10 |
11 |
12 | > **Multi-instance MMKV support** — If you use multiple MMKV instances, they're all detected automatically. Switch between instances and see key counts per instance.
13 |
14 | ---
15 |
16 | ## Installation
17 |
18 |
19 |
20 | That's it. The Storage Explorer auto-detects installed backends and appears in your FloatingDevTools menu.
21 |
22 | ---
23 |
24 | ## What You Can Do
25 |
26 |
27 |
28 | ---
29 |
30 | ## Smart Features
31 |
32 | **JSON formatting** — Values that are valid JSON are automatically pretty-printed for readability.
33 |
34 | **Live events** — Watch storage changes happen in real-time as your app reads and writes data.
35 |
36 | **Bulk selection** — Select multiple keys to delete or export them all at once.
37 |
38 | ---
39 |
40 | ## What's Next
41 |
42 | - [Network Monitor](./network) — See every API call your app makes
43 | - [Environment Inspector](./env) — Validate env vars with type checking
44 | - [React Query](./react-query) — Inspect query cache and simulate states
45 |
--------------------------------------------------------------------------------
/docs/tools/routes.md:
--------------------------------------------------------------------------------
1 | ---
2 | title: Route Inspector
3 | id: tools-routes
4 | ---
5 |
6 | See every route in your app and track navigation in real-time. Browse your sitemap, jump to any screen, and debug navigation issues instantly.
7 |
8 | ## Supported Libraries
9 |
10 |
11 |
12 | > **Auto-detection** — The Route Inspector automatically detects which navigation library you're using and adapts accordingly.
13 |
14 | ---
15 |
16 | ## Installation
17 |
18 |
19 |
20 | That's it. The Route Inspector auto-detects your navigation setup and appears in your FloatingDevTools menu.
21 |
22 | ---
23 |
24 | ## What You Can Do
25 |
26 |
27 |
28 | ---
29 |
30 | ## Route Types
31 |
32 |
33 |
34 | ---
35 |
36 | ## Event Timeline
37 |
38 | Every navigation is tracked with:
39 |
40 | - **Path** — Where you navigated to
41 | - **Params** — Route parameters passed
42 | - **Timestamp** — When it happened
43 | - **Duration** — Time since previous navigation
44 |
45 | ---
46 |
47 | ## What's Next
48 |
49 | - [Network Monitor](./network) — See every API call your app makes
50 | - [Storage Explorer](./storage) — Browse and edit AsyncStorage & MMKV
51 | - [React Query DevTools](./react-query) — Inspect query cache and simulate states
52 |
--------------------------------------------------------------------------------
/docs/config.json:
--------------------------------------------------------------------------------
1 | {
2 | "$schema": "https://raw.githubusercontent.com/TanStack/tanstack.com/main/tanstack-docs-config.schema.json",
3 | "docSearch": {
4 | "appId": "",
5 | "apiKey": "",
6 | "indexName": "react-buoy"
7 | },
8 | "sections": [
9 | {
10 | "label": "Getting Started",
11 | "children": [
12 | {
13 | "label": "Overview",
14 | "to": "overview"
15 | },
16 | {
17 | "label": "Quick Start",
18 | "to": "quick-start"
19 | },
20 | {
21 | "label": "Installation",
22 | "to": "installation"
23 | }
24 | ]
25 | },
26 | {
27 | "label": "Core Concepts",
28 | "children": [
29 | {
30 | "label": "FloatingDevTools",
31 | "to": "floating-devtools"
32 | },
33 | {
34 | "label": "Custom Tools",
35 | "to": "custom-tools"
36 | }
37 | ]
38 | },
39 | {
40 | "label": "Available Tools",
41 | "children": [
42 | {
43 | "label": "Environment Inspector",
44 | "to": "tools/env"
45 | },
46 | {
47 | "label": "Network Monitor",
48 | "to": "tools/network"
49 | },
50 | {
51 | "label": "Storage Explorer",
52 | "to": "tools/storage"
53 | },
54 | {
55 | "label": "React Query DevTools",
56 | "to": "tools/react-query"
57 | },
58 | {
59 | "label": "Route Inspector",
60 | "to": "tools/routes"
61 | }
62 | ]
63 | }
64 | ]
65 | }
66 |
--------------------------------------------------------------------------------
/docs/tools/react-query.md:
--------------------------------------------------------------------------------
1 | ---
2 | title: React Query DevTools
3 | id: tools-react-query
4 | ---
5 |
6 | Full TanStack Query inspection for React Native. Browse queries, view cached data, simulate states, and debug your data fetching in real-time.
7 |
8 | ## Installation
9 |
10 |
11 |
12 | That's it. The React Query DevTools auto-detects your QueryClient and appears in your FloatingDevTools menu.
13 |
14 | ---
15 |
16 | ## Query States
17 |
18 |
19 |
20 | ---
21 |
22 | ## What You Can Do
23 |
24 |
25 |
26 | > **Simulate loading & error states** — Test how your UI handles loading spinners and error boundaries without waiting for real network conditions.
27 |
28 | ---
29 |
30 | ## Mutations
31 |
32 | Track all your mutations in real-time:
33 |
34 | - **Status** — idle, pending, success, or error
35 | - **Variables** — data passed to the mutation
36 | - **Response** — returned data or error message
37 | - **Timing** — when the mutation was submitted
38 |
39 | ---
40 |
41 | ## WiFi Toggle
42 |
43 | Simulate offline mode with one tap. The WiFi toggle controls React Query's `onlineManager` to pause all queries — perfect for testing offline-first features.
44 |
45 | ---
46 |
47 | ## What's Next
48 |
49 | - [Network Monitor](./network) — See every API call your app makes
50 | - [Storage Explorer](./storage) — Browse and edit AsyncStorage & MMKV
51 | - [Environment Inspector](./env) — Validate env vars with type checking
52 |
--------------------------------------------------------------------------------
/docs/quick-start.md:
--------------------------------------------------------------------------------
1 | ---
2 | title: Quick Start
3 | id: quick-start
4 | ---
5 |
6 | From zero to debugging in under 2 minutes.
7 |
8 | ## 1. Install the core
9 |
10 |
11 |
12 | ## 2. Add to your app
13 |
14 | Drop `FloatingDevTools` at the root of your app:
15 |
16 | ```tsx
17 | import { FloatingDevTools } from "@react-buoy/core";
18 |
19 | export default function App() {
20 | return (
21 | <>
22 |
23 |
24 | >
25 | );
26 | }
27 | ```
28 |
29 | A floating button appears in the corner of your app. Tap it to open the menu.
30 |
31 | ## 3. Add tools
32 |
33 | Install any tool package — it automatically appears in the menu. No wiring, no config.
34 |
35 |
36 |
37 | That's it. Open the menu, tap Network, and you're watching every API call in real-time.
38 |
39 | ## Available tools
40 |
41 |
42 |
43 | Install what you need. Skip what you don't.
44 |
45 | ## Control who sees devtools
46 |
47 | Only show devtools to specific users — admins, QA, internal team members, or whoever your business needs:
48 |
49 | ```tsx
50 | import { FloatingDevTools } from "@react-buoy/core";
51 |
52 | export default function App() {
53 | const { user } = useAuth();
54 |
55 | // Only render for internal users, admins, or QA
56 | const showDevTools =
57 | user?.role === "admin" ||
58 | user?.role === "qa" ||
59 | user?.email?.endsWith("@yourcompany.com");
60 |
61 | return (
62 | <>
63 |
64 | {showDevTools && (
65 |
69 | )}
70 | >
71 | );
72 | }
73 | ```
74 |
75 | Or keep it available for everyone — your QA and support teams will thank you.
76 |
77 | ## What's next
78 |
79 | - [FloatingDevTools](./floating-devtools) — Core component reference
80 | - [Custom Tools](./custom-tools) — Build your own debugging tools
81 |
--------------------------------------------------------------------------------
/docs/floating-devtools.md:
--------------------------------------------------------------------------------
1 | ---
2 | title: FloatingDevTools
3 | id: floating-devtools
4 | ---
5 |
6 | The `FloatingDevTools` component is the entry point for React Buoy. It renders a draggable floating button that opens a menu containing all your installed debugging tools.
7 |
8 | ## Basic Usage
9 |
10 | ```tsx
11 | import { FloatingDevTools } from "@react-buoy/core";
12 |
13 | function App() {
14 | return (
15 | <>
16 |
17 |
18 | >
19 | );
20 | }
21 | ```
22 |
23 | That's it. Any Buoy tool packages you've installed will automatically appear in the menu.
24 |
25 | ## Environment Badge
26 |
27 | The floating button displays your current environment, helping your team instantly know where they are:
28 |
29 | ```tsx
30 |
31 | ```
32 |
33 | Common values: `"local"`, `"dev"`, `"staging"`, `"qa"`, `"production"`
34 |
35 | ## How Tools Auto-Register
36 |
37 | When you install a Buoy tool package (like `@react-buoy/network` or `@react-buoy/storage`), it automatically registers itself with the floating menu. No imports, no configuration, no wiring.
38 |
39 | ```bash
40 | npm install @react-buoy/network
41 | ```
42 |
43 | The Network tool now appears in your menu. That's the magic of Buoy.
44 |
45 | ## Custom Tools
46 |
47 | Need something specific to your app? Add your own tools:
48 |
49 | ```tsx
50 | import { FloatingDevTools } from "@react-buoy/core";
51 |
52 | const FeatureFlagTool = () => (
53 |
54 | Toggle feature flags here
55 |
56 | );
57 |
58 | function App() {
59 | return (
60 |
70 | );
71 | }
72 | ```
73 |
74 | See [Custom Tools](./custom-tools) for more details on building your own debugging tools.
75 |
76 | ## Draggable Button
77 |
78 | The floating button can be dragged anywhere on screen. It remembers its position between sessions, so it stays where your team likes it.
79 |
80 | ## Next Steps
81 |
82 | - [Custom Tools](./custom-tools) — Build team-specific debugging tools
83 | - [Quick Start](./quick-start) — Full setup walkthrough
84 |
--------------------------------------------------------------------------------
/LICENSE:
--------------------------------------------------------------------------------
1 | PROPRIETARY SOFTWARE LICENSE
2 |
3 | Copyright (c) 2024-present React Buoy. All rights reserved.
4 |
5 | This software and its source code are proprietary and confidential.
6 |
7 | NOTICE: This is NOT open source software. This software is licensed,
8 | not sold, and is protected by copyright laws and international treaties.
9 |
10 | TERMS AND CONDITIONS:
11 |
12 | 1. LICENSE GRANT
13 | Subject to the terms of this Agreement and payment of applicable fees,
14 | React Buoy grants you a limited, non-exclusive, non-transferable license
15 | to use the compiled software packages in your applications.
16 |
17 | 2. RESTRICTIONS
18 | You may NOT:
19 | - Copy, modify, or distribute the source code
20 | - Reverse engineer, decompile, or disassemble the software
21 | - Remove or alter any proprietary notices or labels
22 | - Sublicense, rent, lease, or lend the software
23 | - Use the software to create competing products
24 | - Share access credentials with unauthorized parties
25 |
26 | 3. OWNERSHIP
27 | React Buoy retains all right, title, and interest in the software,
28 | including all intellectual property rights. This license does not
29 | grant you any rights to trademarks or service marks.
30 |
31 | 4. TERMINATION
32 | This license is effective until terminated. Your rights under this
33 | license will terminate automatically without notice if you fail to
34 | comply with any of its terms. Upon termination, you must cease all
35 | use and destroy all copies of the software.
36 |
37 | 5. DISCLAIMER OF WARRANTIES
38 | THE SOFTWARE IS PROVIDED "AS IS" WITHOUT WARRANTY OF ANY KIND,
39 | EXPRESS OR IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF
40 | MERCHANTABILITY, FITNESS FOR A PARTICULAR PURPOSE, AND NONINFRINGEMENT.
41 |
42 | 6. LIMITATION OF LIABILITY
43 | IN NO EVENT SHALL REACT BUOY BE LIABLE FOR ANY INDIRECT, INCIDENTAL,
44 | SPECIAL, EXEMPLARY, OR CONSEQUENTIAL DAMAGES ARISING OUT OF OR IN
45 | CONNECTION WITH THIS LICENSE OR THE USE OF THE SOFTWARE.
46 |
47 | 7. GOVERNING LAW
48 | This Agreement shall be governed by and construed in accordance with
49 | the laws of the United States, without regard to its conflict of
50 | law provisions.
51 |
52 | For licensing inquiries and subscription information:
53 | - Website: https://buoy.gg
54 | - Email: austinlovesworking@gmail.com
55 |
56 | Unauthorized reproduction or distribution of this software, or any
57 | portion of it, may result in severe civil and criminal penalties,
58 | and will be prosecuted to the maximum extent possible under the law.
59 |
--------------------------------------------------------------------------------
/docs/custom-tools.md:
--------------------------------------------------------------------------------
1 | ---
2 | title: Custom Tools
3 | id: custom-tools
4 | ---
5 |
6 | React Buoy is fully extensible. You can add any React component as a custom debugging tool.
7 |
8 | ## Basic Custom Tool
9 |
10 | ```tsx
11 | import { FloatingDevTools } from "@react-buoy/core";
12 | import { View, Text, Button } from "react-native";
13 |
14 | const CacheDebugger = () => {
15 | const clearCache = () => {
16 | // Your cache clearing logic
17 | };
18 |
19 | return (
20 |
21 | Cache Status: 42 items
22 |
23 |
24 | );
25 | };
26 |
27 | function App() {
28 | return (
29 |
39 | );
40 | }
41 | ```
42 |
43 | ## Custom Tool Schema
44 |
45 | ```typescript
46 | interface CustomTool {
47 | /** Display name in the menu */
48 | name: string;
49 |
50 | /** The React component to render */
51 | component: React.ComponentType;
52 |
53 | /** Emoji or icon to display */
54 | icon?: string;
55 |
56 | /** Optional description shown in menu */
57 | description?: string;
58 | }
59 | ```
60 |
61 | ## Multiple Custom Tools
62 |
63 | ```tsx
64 |
87 | ```
88 |
89 | ## Accessing App State
90 |
91 | Your custom tools can use any React hooks or context:
92 |
93 | ```tsx
94 | import { useAuth } from "./hooks/useAuth";
95 | import { useQueryClient } from "@tanstack/react-query";
96 |
97 | const AuthDebugger = () => {
98 | const { user, logout } = useAuth();
99 | const queryClient = useQueryClient();
100 |
101 | const forceLogout = () => {
102 | logout();
103 | queryClient.clear();
104 | };
105 |
106 | return (
107 |
108 | User: {user?.email ?? "Not logged in"}
109 | Role: {user?.role}
110 |
111 |
112 | );
113 | };
114 | ```
115 |
116 | ## Next Steps
117 |
118 | - [FloatingDevTools](./floating-devtools) — Core component reference
119 | - [Quick Start](./quick-start) — Full setup walkthrough
120 |
--------------------------------------------------------------------------------
/docs/tools/env.md:
--------------------------------------------------------------------------------
1 | ---
2 | title: Environment Inspector
3 | id: tools-env
4 | ---
5 |
6 | The Environment Inspector tool lets you view and validate environment variables in your React Native app. It automatically discovers `EXPO_PUBLIC_` prefixed variables and provides validation, type detection, and health monitoring.
7 |
8 | ## Installation
9 |
10 |
11 |
12 | After installation, the Environment Inspector will be auto-detected and appear in your FloatingDevTools menu.
13 |
14 | ## Custom Configuration
15 |
16 | For more control, use `createEnvTool` with the `envVar` builder to define required variables and validation rules:
17 |
18 | ```tsx
19 | import { createEnvTool, envVar } from "@react-buoy/env";
20 |
21 | const envTool = createEnvTool({
22 | requiredEnvVars: [
23 | envVar("EXPO_PUBLIC_API_URL").exists(),
24 | envVar("EXPO_PUBLIC_DEBUG_MODE").withType("boolean").build(),
25 | envVar("EXPO_PUBLIC_ENVIRONMENT").withValue("development").build(),
26 | envVar("EXPO_PUBLIC_MAX_RETRIES")
27 | .withType("number")
28 | .withDescription("Maximum API retry attempts")
29 | .build(),
30 | ],
31 | });
32 | ```
33 |
34 | ## The `envVar` Builder
35 |
36 | The fluent builder API makes it easy to define environment variable requirements:
37 |
38 | ```tsx
39 | envVar("API_KEY")
40 | .withType("string") // Set expected type
41 | .withValue("sk_test_123") // Or set expected value
42 | .withDescription("API Key") // Add documentation
43 | .build() // Finalize config
44 |
45 | // Shorthand for just checking existence
46 | envVar("API_KEY").exists()
47 | ```
48 |
49 | ### Supported Types
50 |
51 | ```typescript
52 | type EnvVarType = "string" | "number" | "boolean" | "array" | "object" | "url";
53 | ```
54 |
55 | ## `createEnvTool` Options
56 |
57 | ```typescript
58 | createEnvTool({
59 | name?: string; // default: "ENV"
60 | description?: string;
61 | colorPreset?: "orange" | "cyan" | "purple" | "pink" | "yellow" | "green"; // default: "green"
62 | id?: string; // default: "env"
63 | requiredEnvVars?: RequiredEnvVar[];
64 | enableSharedModalDimensions?: boolean;
65 | });
66 | ```
67 |
68 | ## Features
69 |
70 | - **Automatic Discovery** - Auto-collects all `EXPO_PUBLIC_` prefixed variables
71 | - **Required Variable Validation** - Define which vars must exist with expected values/types
72 | - **Type Detection** - Auto-detects: string, number, boolean, array, object, url, json
73 | - **Search & Filtering** - Real-time search + filters for "All", "Missing", "Issues"
74 | - **Health Status** - Health percentage (0-100%) with HEALTHY/WARNING/ERROR/CRITICAL states
75 | - **Statistics** - Total count, required count, missing count, wrong value/type counts
76 | - **Copy to Clipboard** - Copy any value with one tap
77 |
78 | ## Variable Status Types
79 |
80 | | Status | Description |
81 | |--------|-------------|
82 | | `required_present` | Required var is set and correct |
83 | | `required_missing` | Required var is not set |
84 | | `required_wrong_value` | Set but doesn't match expected value |
85 | | `required_wrong_type` | Set but wrong type |
86 | | `optional_present` | Optional var that is set |
87 |
88 | ## Validation Visual Indicators
89 |
90 | - **Green** - Variable exists and matches expected value/type
91 | - **Yellow** - Variable exists but value/type differs from expected
92 | - **Red** - Required variable is missing
93 |
94 | ## Try It Out
95 |
96 | Use the interactive builder below to create your environment validation config. Add variables, configure checks (type, value, description), and export the code directly.
97 |
98 |
99 |
--------------------------------------------------------------------------------
/docs/overview.md:
--------------------------------------------------------------------------------
1 | ---
2 | title: Overview
3 | id: overview
4 | ---
5 |
6 | Buoy is a floating dev tools menu for React Native. It turns **hours into seconds** for developers, QA, and product teams on tasks like regression testing, bug reproduction, and environment validation.
7 |
8 | One floating button. Every tool your team needs. Works in dev, staging, and production.
9 |
10 | ## Who It's For
11 |
12 |
13 |
14 |
15 | - **Storage event history** — Watch data changes in real-time. Step forward and backward through events.
16 | - **Network inspector** — Every request, response, header, and error. No more console.log debugging.
17 | - **Reproduce anything** — Open the tools, see the exact state, and reproduce bugs locally in seconds.
18 |
19 | *"Before: Bug report → Ask for details → Add console.logs → Rebuild → Try to reproduce → Guess at state → Repeat"*
20 |
21 | *"After: Bug report → Open Buoy → See exact state → Fix"*
22 |
23 |
24 |
25 | - **Trigger any state** — Loading states, error states, empty states, edge cases. Now you can test them all.
26 | - **Edit data live** — Change values in seconds. No more waiting for database changes.
27 | - **Validate everything** — Storage validators flag missing keys, wrong types, and invalid values instantly.
28 | - **Real regression testing** — Test the app AND the API. Stale data, race conditions, permission edge cases.
29 |
30 | *"Before: Need edge case → Ask dev to update DB → Wait 30+ min → Test → Need another change → Wait again → Repeat"*
31 |
32 | *"After: Need edge case → Edit value in Buoy → Test → Edit again → Test again → Done in seconds"*
33 |
34 |
35 |
36 | - **Impersonation tools** — Sync as a user and see their exact state. No more "works on my machine."
37 | - **Copy debug data** — Grab storage state, network logs, and environment info for bug reports.
38 | - **Instant answers** — Is the data wrong or is it a refresh issue? Check storage. Is the API failing? Check network.
39 |
40 | *"Before: Customer reports issue → Ask for screenshots → Ask for more info → Escalate to dev → Dev can't reproduce → Back and forth for days"*
41 |
42 | *"After: Customer reports issue → Impersonate user → See exact state → Copy debug data → Dev reproduces instantly"*
43 |
44 |
45 |
46 | - **Feature flags in seconds** — No more asking someone to enable a feature on your account.
47 | - **Skip the login dance** — Need to test as admin? As a new user? As a banned user? Just set it.
48 | - **Jump to any route** — Go directly to the screen you need. Validate auth checks and permissions.
49 |
50 | *"Before: Need feature flag → Slack dev → Wait → Need admin role → Slack another dev → Wait → Log out → Log in → Navigate to screen"*
51 |
52 | *"After: Open Buoy → Toggle flag → Set role → Jump to route → Done"*
53 |
54 |
55 |
56 |
57 | ---
58 |
59 | This isn't a "nice to have." It's the difference between hours of debugging and coordination versus seconds. The time savings compound across your entire team.
60 |
61 | ## What You Get
62 |
63 | | Tool | What It Does |
64 | |------|--------------|
65 | | **Network** | See every API call — request, response, timing, errors |
66 | | **Storage** | Browse and edit AsyncStorage & MMKV in real-time |
67 | | **Environment** | Validate env vars with type checking and required field validation |
68 | | **Debug Borders** | Tap any element to see its testID, accessibility label, and styles |
69 | | **Route Events** | Track navigation changes and browse your route structure |
70 | | **React Query** | Inspect query cache, trigger refetches, simulate offline mode |
71 | | **Render Highlighter** | Spot unnecessary re-renders as they happen |
72 |
73 | ## Why Buoy
74 |
75 | - **Zero config** — Install a package, it appears in the menu. No wiring.
76 | - **Works everywhere** — Dev, staging, production. Same tools for everyone.
77 | - **Modular** — Only install what you need. Each tool is a separate package.
78 | - **Team-friendly** — Onboard new devs in minutes with consistent debugging.
79 |
80 | ## Quick Start
81 |
82 | ```tsx
83 | import { FloatingDevTools } from "@react-buoy/core";
84 |
85 | export default function App() {
86 | return (
87 | <>
88 |
89 |
90 | >
91 | );
92 | }
93 | ```
94 |
95 | Install any tool package and it automatically appears in the menu. No configuration needed.
96 |
97 | ## Build Your Own Tools
98 |
99 | Need something specific to your app? Drop in any React component as a custom tool. Build internal debugging utilities, feature flag toggles, or team-specific inspectors that integrate seamlessly with the floating menu.
100 |
101 | ## Next Steps
102 |
103 | - [Installation](./installation) — Add Buoy to your project
104 | - [Quick Start](./quick-start) — Full setup in 2 minutes
105 | - [Custom Tools](./custom-tools) — Build your own debugging tools
106 | - [Tools Reference](./tools/network) — Detailed docs for each tool
107 |
--------------------------------------------------------------------------------
/README.md:
--------------------------------------------------------------------------------
1 | # BUOY Devtools
2 |
3 | > **⚠️ ACTIVE DEVELOPMENT**
4 | > This project is under active development. If you encounter any issues, please [open an issue on GitHub](https://github.com/Buoy-gg/buoy/issues).
5 | > Feature requests and suggestions are also highly encouraged! I love to hear what you need!
6 | >
7 | > ⭐ **Please star this repo!** We ship updates frequently, and starring helps you stay notified of new features and improvements.
8 |
9 | [](https://www.npmjs.com/package/@react-buoy/core)
10 | [](https://www.npmjs.com/package/@react-buoy/core)
11 | [](https://www.npmjs.com/package/@react-buoy/core)
12 | [](https://www.npmjs.com/package/react-native-react-query-devtools)
13 | [](https://www.npmjs.com/package/@react-buoy/core)
14 | [](https://www.typescriptlang.org/)
15 | [](https://opensource.org/licenses/MIT)
16 |
17 | **Zero-config mobile dev tools that just work.**
18 |
19 | A single floating menu gives your entire team instant access to powerful debugging tools—in dev, staging, AND production. No configuration, no complexity. Just install packages and they automatically appear.
20 |
21 | 
22 |
23 | ---
24 |
25 | ## ⚡ 2-Minute Setup
26 |
27 | ### 1. Install Core + Tools
28 |
29 | ```bash
30 | npm install @react-buoy/core @react-buoy/env @react-buoy/network
31 | # or: pnpm add / yarn add / bun add
32 | ```
33 |
34 | ### 2. Add to Your App
35 |
36 | ```tsx
37 | import { FloatingDevTools } from "@react-buoy/core";
38 |
39 | function App() {
40 | return (
41 | <>
42 | {/* Your app content */}
43 |
44 | >
45 | );
46 | }
47 | ```
48 |
49 | ### 3. That's It! 🎉
50 |
51 | All installed tools automatically appear in your floating menu. No config needed.
52 |
53 | > 💡 **Pro Tip**: Install all tools at once:
54 | >
55 | > ```bash
56 | > npm i @react-buoy/{core,env,network,storage,react-query,route-events,debug-borders,highlight-updates}
57 | > ```
58 |
59 | ---
60 |
61 | ## 🎯 What You Get
62 |
63 | **✨ Zero Configuration** – Install packages, they auto-appear. No manual setup.
64 |
65 | **🏷️ Always-Visible Context** – See your environment (dev/staging/prod) and role at a glance.
66 |
67 | **🔄 Persistent State** – Tools remember their position and state through reloads.
68 |
69 | **📍 Minimizable Interface** – Minimize open tools to small floating indicators. Quick-restore with a tap or swipe down to dismiss.
70 |
71 | **👥 Team-Friendly** – Same tools everywhere. Onboard new devs in minutes.
72 |
73 | **🎨 Beautiful UI** – Draggable menu with modal and bottom-sheet views.
74 |
75 | **🔌 Fully Extensible** – Drop in any React component as a custom tool.
76 |
77 | ---
78 |
79 | ## 📦 Available Tools
80 |
81 | Install any combination to customize your dev menu:
82 |
83 | | Tool | Package | What It Does | Key Features |
84 | | ------------------ | ------------------------------- | ------------------------------ | -------------------------------------------------- |
85 | | 🌍 **ENV** | `@react-buoy/env` | Environment variable inspector | Validation, search, type checking, warnings |
86 | | 📡 **Network** | `@react-buoy/network` | API request monitor | Timeline view, filtering, performance metrics |
87 | | 💾 **Storage** | `@react-buoy/storage` | AsyncStorage/MMKV browser | View/edit/delete, bulk ops, validation |
88 | | ⚡ **React Query** | `@react-buoy/react-query` | TanStack Query devtools | Cache inspector, offline toggle, refetch |
89 | | 🧭 **Routes** | `@react-buoy/route-events` | Route & navigation tracker | Sitemap, stack view, event timeline |
90 | | 🎨 **Borders** | `@react-buoy/debug-borders` | Visual layout debugger | 3 modes, tap-to-inspect labels, smart filtering |
91 | | 🔄 **Highlights** | `@react-buoy/highlight-updates` | Render highlight tracker | Visual re-render detection, render counts, history |
92 | | 🔀 **Env Switch** | `@react-buoy/core` | Environment switcher | Switch between dev/qa/staging/prod environments |
93 |
94 | **Installation Pattern**: All packages follow the same simple pattern:
95 |
96 | ```bash
97 | npm install @react-buoy/{tool-name}
98 | # Peer dependencies auto-detected (e.g., @tanstack/react-query, @react-native-async-storage/async-storage)
99 | ```
100 |
101 | **That's it!** Once installed, each tool automatically appears in `FloatingDevTools`.
102 |
103 |
104 | 📸 View screenshots for each tool
105 |
106 | ### Environment Inspector
107 |
108 |
109 | Show preview
110 |
111 | 
112 |
113 |
114 |
115 | ### Network Monitor
116 |
117 |
118 | Show preview
119 |
120 | 
121 |
122 |
123 |
124 | ### Storage Browser
125 |
126 |
127 | Show preview
128 |
129 | 
130 |
131 |
132 |
133 | ### React Query DevTools
134 |
135 |
136 | Show preview
137 |
138 | 
139 |
140 |
141 |
142 | ### Route Tracker
143 |
144 |
145 | Show preview
146 |
147 | 
148 |
149 |
150 |
151 | ### Debug Borders
152 |
153 |
154 | Show preview
155 |
156 | 
157 |
158 |
159 |
160 | ### Highlight Updates
161 |
162 |
163 | Show preview
164 |
165 |
166 |
167 | _Screenshot coming soon_
168 |
169 |
170 |
171 |
172 |
173 | ---
174 |
175 | ## 🚀 Choose Your Path
176 |
177 | **👶 Just Starting?**
178 |
179 | - Follow the [2-Minute Setup](#-2-minute-setup) above
180 | - All tools work with zero config
181 |
182 | **🔧 Need Validation?**
183 |
184 | - See [Configuration](#-configuration) below for env var and storage validation
185 |
186 | **🎨 Building Custom Tools?**
187 |
188 | - Check out [Custom Tools](#-custom-tools) section
189 |
190 | **📖 Want Deep Dive?**
191 |
192 | - View [detailed package docs](#-package-details) (collapsed sections)
193 |
194 | ---
195 |
196 | ## ⚙️ Configuration
197 |
198 | ### Basic Usage (Zero Config)
199 |
200 | ```tsx
201 |
202 | ```
203 |
204 | That's all you need! But if you want validation...
205 |
206 | ### Disabling Onboarding Hints
207 |
208 | If you don't want to show any first-time user hints (clipboard tips, modal hints, onboarding tooltips), you can disable them all with a single prop:
209 |
210 | ```tsx
211 |
212 | ```
213 |
214 | ### With Environment Variable Validation
215 |
216 | ```tsx
217 | import { FloatingDevTools } from "@react-buoy/core";
218 | import type { EnvVarConfig } from "@react-buoy/core";
219 |
220 | const requiredEnvVars: EnvVarConfig[] = [
221 | "API_URL", // Just check if exists
222 | { key: "DEBUG_MODE", expectedType: "boolean" },
223 | { key: "ENVIRONMENT", expectedValue: "development" },
224 | ];
225 |
226 | ;
231 | ```
232 |
233 | ### With Storage Key Validation
234 |
235 | ```tsx
236 | import type { StorageKeyConfig } from "@react-buoy/core";
237 |
238 | const requiredStorageKeys: StorageKeyConfig[] = [
239 | {
240 | key: "@app/session",
241 | expectedType: "string",
242 | description: "User session token",
243 | storageType: "async", // "async" | "mmkv" | "secure"
244 | },
245 | ];
246 |
247 | ;
251 | ```
252 |
253 | ### Complete Example with React Query
254 |
255 | ```tsx
256 | import React from "react";
257 | import { QueryClient, QueryClientProvider } from "@tanstack/react-query";
258 | import { FloatingDevTools } from "@react-buoy/core";
259 | import type { EnvVarConfig, StorageKeyConfig } from "@react-buoy/core";
260 |
261 | export default function App() {
262 | const queryClient = new QueryClient();
263 |
264 | const requiredEnvVars: EnvVarConfig[] = [
265 | "EXPO_PUBLIC_API_URL",
266 | { key: "EXPO_PUBLIC_DEBUG_MODE", expectedType: "boolean" },
267 | ];
268 |
269 | const requiredStorageKeys: StorageKeyConfig[] = [
270 | {
271 | key: "@app/session",
272 | expectedType: "string",
273 | storageType: "async",
274 | },
275 | ];
276 |
277 | return (
278 |
279 | {/* Your app content */}
280 |
281 |
287 |
288 | );
289 | }
290 | ```
291 |
292 | > 💡 **Note**: All types (`EnvVarConfig`, `StorageKeyConfig`, etc.) are exported from `@react-buoy/core`
293 |
294 | ---
295 |
296 | ## 🔧 How It Works
297 |
298 | BUOY uses **automatic package discovery**. When you render ``, it:
299 |
300 | 1. **Checks** which `@react-buoy/*` packages are installed
301 | 2. **Loads** only the installed packages (lazy + safe)
302 | 3. **Renders** them automatically in the floating menu
303 |
304 | No registration, no imports, no config arrays. Just install and go.
305 |
306 | **Behind the scenes**: The core package attempts to `require()` each plugin. If installed, it loads. If not, it silently skips. This means:
307 |
308 | - ✅ Zero config for the 90% use case
309 | - ✅ No crashes from missing packages
310 | - ✅ Automatic updates when you install new tools
311 |
312 | **Want full control?** You can still manually configure tools with the `apps` prop (see [Advanced Configuration](#advanced-configuration)).
313 |
314 | ---
315 |
316 | ## 🎨 Custom Tools
317 |
318 | Any React component can be a dev tool! Perfect for:
319 |
320 | - 🚀 Feature flag toggles
321 | - 👤 User impersonation panels
322 | - ✅ QA checklists
323 | - 📊 Analytics dashboards
324 | - 🗄️ Database browsers
325 | - 📱 Push notification testers
326 |
327 | ### Basic Custom Tool
328 |
329 | ```tsx
330 | import { FloatingDevTools } from "@react-buoy/core";
331 | import type { InstalledApp } from "@react-buoy/core";
332 |
333 | // Your custom tool - just a React component
334 | function FeatureFlagsModal({ onClose }) {
335 | return (
336 |
337 | Feature Flags
338 | {/* Your UI here */}
339 |
340 |
341 | );
342 | }
343 |
344 | // Define the tool
345 | const customTools: InstalledApp[] = [
346 | {
347 | id: "feature-flags",
348 | name: "FLAGS",
349 | description: "Toggle feature flags",
350 | slot: "both", // "row" | "dial" | "both"
351 | icon: ({ size }) => ,
352 | component: FeatureFlagsModal,
353 | props: {},
354 | },
355 | ];
356 |
357 | // Add to FloatingDevTools
358 | ;
362 | ```
363 |
364 | > ✨ **Auto-discovery still works!** Custom tools merge with auto-discovered tools. Same ID = your custom tool overrides.
365 |
366 | ---
367 |
368 | ## 📚 Package Details
369 |
370 |
371 | 🌍 Environment Inspector (@react-buoy/env)
372 |
373 | ### What It Does
374 |
375 | Visual health check for your app configuration. Validates environment variables, checks types, and warns about missing/incorrect values.
376 |
377 | ### Install
378 |
379 | ```bash
380 | npm install @react-buoy/env
381 | ```
382 |
383 | ### Features
384 |
385 | - ✅ Visual validation of required environment variables
386 | - 🔍 Search and filter across all env vars
387 | - 🎯 Type checking (string, number, boolean, object)
388 | - ⚠️ Clear warnings for missing or incorrect values
389 | - 📋 Copy values to clipboard
390 |
391 | ### Optional: Helper Functions for Better DX
392 |
393 | ```tsx
394 | import { createEnvVarConfig, envVar } from "@react-buoy/env";
395 | import type { EnvVarConfig } from "@react-buoy/core";
396 |
397 | const requiredEnvVars: EnvVarConfig[] = createEnvVarConfig([
398 | envVar("API_URL").exists(),
399 | envVar("DEBUG_MODE").withType("boolean").build(),
400 | envVar("ENVIRONMENT").withValue("development").build(),
401 | ]);
402 | ```
403 |
404 |
405 |
406 |
407 | 📡 Network Inspector (@react-buoy/network)
408 |
409 | ### What It Does
410 |
411 | Real-time network request monitoring with timeline view, detailed inspection, and performance stats.
412 |
413 | ### Install
414 |
415 | ```bash
416 | npm install @react-buoy/network
417 | ```
418 |
419 | ### Features
420 |
421 | - 📊 Timeline view of all network requests
422 | - 🔍 Detailed request/response inspection with JSON viewer
423 | - ⚡ Performance metrics and timing breakdown
424 | - 🎛️ Filter by status, method, URL patterns
425 | - 📋 Copy request details (curl, JSON, etc.)
426 | - 🔴 Highlight failed requests
427 |
428 |
429 |
430 |
431 | 💾 Storage Explorer (@react-buoy/storage)
432 |
433 | ### What It Does
434 |
435 | Real-time storage browser for AsyncStorage, MMKV, and SecureStore with live updates and bulk operations.
436 |
437 | ### Install
438 |
439 | ```bash
440 | npm install @react-buoy/storage
441 | npm install @react-native-async-storage/async-storage # peer dependency
442 | npm install react-native-mmkv # optional - for MMKV support
443 | ```
444 |
445 | ### Features
446 |
447 | - 🗂️ Browse all AsyncStorage, MMKV, and SecureStore data
448 | - ✏️ Edit storage values in real-time
449 | - 🗑️ Bulk delete operations
450 | - 🔍 Search and filter storage keys
451 | - ⚠️ Validation for required storage keys
452 | - 📋 Copy keys/values
453 |
454 | ### Supports Multiple Storage Types
455 |
456 | - **AsyncStorage**: React Native standard (auto-detected)
457 | - **MMKV**: Encrypted, faster alternative (requires registration)
458 | - **SecureStore**: iOS Keychain / Android Keystore (coming soon)
459 |
460 | ### MMKV Setup (react-native-mmkv v4+)
461 |
462 | MMKV instances need to be manually registered:
463 |
464 | ```tsx
465 | import { createMMKV } from "react-native-mmkv";
466 | import { registerMMKVInstance } from "@react-buoy/storage";
467 |
468 | // Create your MMKV instances
469 | export const storage = createMMKV({ id: "mmkv.default" });
470 | export const authStorage = createMMKV({
471 | id: "auth.storage",
472 | encryptionKey: "your-encryption-key",
473 | });
474 |
475 | // Register them with the storage dev tool
476 | try {
477 | registerMMKVInstance("mmkv.default", storage);
478 | registerMMKVInstance("auth.storage", authStorage, { encrypted: true });
479 | } catch {
480 | // Storage package not installed - that's fine
481 | }
482 | ```
483 |
484 | **Why?** react-native-mmkv v4 uses read-only exports which prevents automatic detection. Manual registration is a one-time setup per instance.
485 |
486 | **Note:** Registration is safe in production - it only takes effect when `` is rendered.
487 |
488 |
489 |
490 |
491 | ⚡ React Query DevTools (@react-buoy/react-query)
492 |
493 | ### What It Does
494 |
495 | TanStack Query devtools adapted for mobile with query explorer, cache manipulation, and offline toggle.
496 |
497 | ### Install
498 |
499 | ```bash
500 | npm install @react-buoy/react-query
501 | npm install @tanstack/react-query # peer dependency (v5+)
502 | ```
503 |
504 | ### Setup
505 |
506 | Wrap your app with `QueryClientProvider`:
507 |
508 | ```tsx
509 | import { QueryClient, QueryClientProvider } from "@tanstack/react-query";
510 | import { FloatingDevTools } from "@react-buoy/core";
511 |
512 | const queryClient = new QueryClient();
513 |
514 | function App() {
515 | return (
516 |
517 | {/* Your app */}
518 |
519 |
520 | );
521 | }
522 | ```
523 |
524 | ### Features
525 |
526 | - 🔍 Query explorer with real-time data
527 | - 🗂️ Cache inspection and manipulation
528 | - 📊 Query performance metrics
529 | - 🔄 Manual query refetching and invalidation
530 | - 📶 **WiFi Toggle** - Simulate offline mode
531 | - 🎨 Query state visualization (loading, error, success)
532 |
533 |
534 |
535 |
536 | 🧭 Route Events (@react-buoy/route-events)
537 |
538 | ### What It Does
539 |
540 | Comprehensive route tracking and visualization for Expo Router applications. Monitor route changes, explore your app's sitemap, and visualize the navigation stack.
541 |
542 | ### Install
543 |
544 | ```bash
545 | npm install @react-buoy/route-events
546 | npm install expo-router @react-navigation/native # peer dependencies
547 | ```
548 |
549 | ### Features
550 |
551 | - 🗺️ **Route Sitemap** - Browse all routes with search
552 | - 📊 **Event Timeline** - Chronological route changes
553 | - 🏗️ **Navigation Stack** - Real-time stack visualization
554 | - 🔍 **Event Inspection** - Detailed params, segments, timing
555 | - 🎯 **Filtering** - Filter by pathname patterns
556 | - ⏱️ **Performance Metrics** - Navigation timing
557 | - ✨ **Zero Config** - Auto-tracks when modal opens
558 |
559 | ### Bonus: Custom Analytics Hook
560 |
561 | ```tsx
562 | import { useRouteObserver } from "@react-buoy/route-events";
563 |
564 | export default function RootLayout() {
565 | useRouteObserver((event) => {
566 | analytics.trackPageView({
567 | path: event.pathname,
568 | params: event.params,
569 | timeSpent: event.timeSincePrevious,
570 | });
571 | });
572 |
573 | return ;
574 | }
575 | ```
576 |
577 |
578 |
579 |
580 | 🎨 Debug Borders (@react-buoy/debug-borders)
581 |
582 | ### What It Does
583 |
584 | Visual debugging tool with three modes: borders only, borders with labels, or off. Labels mode shows only components with `testID` or `accessibilityLabel`, and you can tap any label to inspect the component.
585 |
586 | ### Install
587 |
588 | ```bash
589 | npm install @react-buoy/debug-borders
590 | ```
591 |
592 | ### Features
593 |
594 | - 🔄 **Three Modes** - Tap to cycle: Off → Borders → Labels
595 | - 🏷️ **Smart Labels** - Only shows components with testID or accessibilityLabel
596 | - 👆 **Tap-to-Inspect** - Tap any label to see component details (styles, props, position)
597 | - 🎨 **Color-Coded** - Green = testID, Pink = accessibilityLabel
598 | - 📚 **Label Stacking** - Overlapping labels stack upward like a menu
599 | - 🙈 **Smart Filtering** - Hides inactive screens, SVGs, and devtools components
600 | - ⚡ Zero performance impact when disabled
601 |
602 | ### Usage
603 |
604 | **Zero Config**: Install and it appears as "BORDERS" in the floating menu. Tap to cycle modes.
605 |
606 | **Standalone**:
607 |
608 | ```tsx
609 | import { DebugBordersStandaloneOverlay } from "@react-buoy/debug-borders";
610 |
611 |
612 | ```
613 |
614 |
615 |
616 |
617 | 🔄 Highlight Updates (@react-buoy/highlight-updates)
618 |
619 | ### What It Does
620 |
621 | Visual component re-render tracker that highlights components when they render. Helps identify unnecessary re-renders and performance bottlenecks.
622 |
623 | ### Install
624 |
625 | ```bash
626 | npm install @react-buoy/highlight-updates
627 | ```
628 |
629 | ### Features
630 |
631 | - 🔄 **Visual Render Detection** - See components flash when they re-render
632 | - 🔢 **Render Counts** - See exact render counts on each component to identify problematic re-renders
633 | - 📊 **Render History** - Track which components render and how often
634 | - 🎛️ **Filter Controls** - Filter by component type or render frequency
635 | - 🎭 **Toggle Mode** - Quick tap to enable/disable highlights
636 | - 📋 **Modal View** - Detailed render list with timing information
637 | - ⚡ Zero performance impact when disabled
638 |
639 | ### Usage
640 |
641 | **Zero Config (Recommended)**: Just install and it auto-appears as an "UPDATES" button in the floating menu.
642 |
643 |
644 |
645 |
646 | 🔀 Environment Switcher (@react-buoy/core)
647 |
648 | ### What It Does
649 |
650 | Switch between environments (dev, qa, staging, prod) directly from the floating menu. Built into core—no extra package needed.
651 |
652 | ### Setup
653 |
654 | ```tsx
655 | const [environment, setEnvironment] = useState("dev");
656 |
657 | {
661 | // Your logic: update API URLs, clear caches, etc.
662 | setEnvironment(env);
663 | }}
664 | />
665 | ```
666 |
667 | ### Features
668 |
669 | - 🎯 **Inline Badge** - Shows current environment in the floating row
670 | - 📂 **Animated Dropdown** - Tap to expand and select environment
671 | - ✅ **Visual Feedback** - Checkmark shows current selection
672 | - 🎨 **Color-Coded** - Each environment has a distinct color
673 |
674 |
675 |
676 | ---
677 |
678 | ## 🏗️ Advanced Configuration
679 |
680 |
681 | 📚 Expand for advanced topics
682 |
683 | ### Manual Tool Configuration
684 |
685 | Want to override auto-discovery with full control? Use factory functions:
686 |
687 | ```tsx
688 | import { FloatingDevTools } from "@react-buoy/core";
689 | import { createEnvTool } from "@react-buoy/env";
690 | import { createNetworkTool } from "@react-buoy/network";
691 |
692 | const customTools = [
693 | createEnvTool({
694 | name: "ENVIRONMENT", // Custom name
695 | iconColor: "#9333EA", // Custom color
696 | requiredEnvVars: [...],
697 | }),
698 | createNetworkTool({
699 | name: "API MONITOR",
700 | iconColor: "#EC4899",
701 | }),
702 | ];
703 |
704 |
708 | ````
709 |
710 | ### Complete Manual Setup (No Auto-Discovery)
711 |
712 | ```tsx
713 | import type { InstalledApp } from "@react-buoy/core";
714 | import { EnvVarsModal } from "@react-buoy/env";
715 | import { NetworkModal } from "@react-buoy/network";
716 | import { EnvLaptopIcon, WifiCircuitIcon } from "@react-buoy/shared-ui";
717 |
718 | const manualTools: InstalledApp[] = [
719 | {
720 | id: "env",
721 | name: "ENV",
722 | description: "Environment debugger",
723 | slot: "both",
724 | icon: ({ size }) => ,
725 | component: EnvVarsModal,
726 | props: { requiredEnvVars: [...] },
727 | },
728 | {
729 | id: "network",
730 | name: "NET",
731 | description: "Network logger",
732 | slot: "both",
733 | icon: ({ size }) => ,
734 | component: NetworkModal,
735 | props: {},
736 | },
737 | ];
738 |
739 |
740 | ```
741 |
742 | ### Slot Types
743 |
744 | Control where tools appear:
745 |
746 | ```typescript
747 | type AppSlot = "row" | "dial" | "both";
748 | ```
749 |
750 | - **"row"**: Always-visible header (environment/role badges)
751 | - **"dial"**: Floating expandable menu
752 | - **"both"**: Available in both locations (default)
753 |
754 | ### Launch Modes
755 |
756 | ```typescript
757 | type LaunchMode = "self-modal" | "host-modal" | "inline" | "toggle-only";
758 | ```
759 |
760 | - **"self-modal"**: Tool manages its own modal (default for most)
761 | - **"host-modal"**: Core manages the modal lifecycle
762 | - **"inline"**: Renders inline (no modal)
763 | - **"toggle-only"**: Just triggers an action (e.g., debug-borders)
764 |
765 |
766 |
767 | ---
768 |
769 | ## 🧩 Advanced Features
770 |
771 |
772 | JSON Viewer & Diff Tools
773 |
774 | All tools that display data (Network, Storage, React Query) use optimized JSON viewers:
775 |
776 | ### Tree View
777 |
778 | Like Redux DevTools - explore nested objects with expand/collapse
779 |
780 | ### Side-by-Side Diff
781 |
782 | Like VS Code - compare payloads visually
783 |
784 | ### Type Filtering
785 |
786 | Quickly find what you need in large payloads:
787 |
788 | - String values
789 | - Numbers
790 | - Booleans
791 | - Null/undefined
792 | - Objects
793 | - Arrays
794 | - Functions
795 |
796 | **Example**: Debugging a 5MB API response → filter only booleans to check feature flags, or search undefined keys to spot missing data.
797 |
798 |
799 |
800 |
801 | State Persistence & Minimize Feature
802 |
803 | BUOY remembers:
804 |
805 | - Which tools are open
806 | - Tool positions (if dragged)
807 | - Minimized vs expanded state
808 | - Modal sizes and positions
809 | - User preferences
810 |
811 | ### Storage Backends
812 |
813 | BUOY uses a **smart storage system** that automatically picks the best available option:
814 |
815 | | Backend | Persists Through Logout? | Requires | When Used |
816 | |---------|-------------------------|----------|-----------|
817 | | 📁 **File System** | ✅ Yes | `expo-file-system` | Dev builds, RN CLI |
818 | | 💾 **AsyncStorage** | ❌ No (cleared on logout) | `@react-native-async-storage/async-storage` | Expo Go fallback |
819 | | 🧠 **Memory** | ❌ No (lost on restart) | Nothing | Last resort |
820 |
821 | **Why does this matter?**
822 |
823 | If your app clears `AsyncStorage` during logout (common pattern), your devtools settings would normally be wiped too. With `expo-file-system` installed, settings persist independently—surviving logout flows, `AsyncStorage.clear()` calls, and more.
824 |
825 | **To enable persistent storage:**
826 |
827 | ```bash
828 | # Expo projects
829 | npx expo install expo-file-system
830 |
831 | # RN CLI projects
832 | npm install expo expo-file-system
833 | ```
834 |
835 | You can check which storage backend is active in **Settings → Storage Type** in the devtools menu.
836 |
837 | This means your debugging session survives:
838 |
839 | - ✅ Hot reloads
840 | - ✅ App restarts
841 | - ✅ Crash recovery
842 | - ✅ Logout flows (with file system storage)
843 |
844 | ### Minimize Feature
845 |
846 | Keep tools running in the background without cluttering your screen:
847 |
848 | 1. **Minimize** - Tap the minimize button (−) in any tool's header
849 | 2. **Minimized State** - Tool shrinks to a small floating indicator with its icon
850 | 3. **Restore** - Tap the minimized indicator to restore the full tool
851 | 4. **Dismiss** - Swipe down on the minimized indicator to close the tool completely
852 |
853 | **Why minimize?**
854 |
855 | - 👁️ Reduces visual clutter while debugging
856 | - ⚡ Keeps tools running (e.g., network monitor keeps capturing)
857 | - 🔄 Quick restore without reloading tool state
858 | - 🎯 Perfect for monitoring tools you want to keep "in the background"
859 |
860 | **Example Use Case**: Minimize the Network monitor while testing your UI, then restore it when you need to check API calls—all captured data is still there.
861 |
862 |
863 |
864 |
865 | Production Usage
866 |
867 | BUOY is **production-safe** with proper access controls:
868 |
869 | ```tsx
870 | import { FloatingDevTools } from "@react-buoy/core";
871 | import { useUser } from "./auth";
872 |
873 | function App() {
874 | const user = useUser();
875 | const showDevTools = user.role === "admin" || __DEV__;
876 |
877 | return (
878 | <>
879 | {/* Your app */}
880 | {showDevTools && (
881 |
885 | )}
886 | >
887 | );
888 | }
889 | ```
890 |
891 | **Recommendation**: Gate with your existing authentication/authorization system.
892 |
893 |
894 |
895 | ---
896 |
897 | ## 🆚 Why BUOY?
898 |
899 | ### vs. Reactotron
900 |
901 | - ✅ Zero config (Reactotron requires manual command registration)
902 | - ✅ In-app UI (Reactotron requires external app)
903 | - ✅ Production-safe with auth (Reactotron is dev-only)
904 | - ✅ Plugin architecture (install packages = auto-appear)
905 |
906 | ### vs. Flipper
907 |
908 | - ✅ Zero setup (Flipper requires native config + desktop app)
909 | - ✅ Works on physical devices out-of-the-box
910 | - ✅ Lightweight (Flipper is heavy)
911 | - ✅ Team-friendly (no desktop app to install)
912 |
913 | ### vs. react-native-debugger
914 |
915 | - ✅ Modern (supports Hermes, new architecture)
916 | - ✅ In-app (no external tools)
917 | - ✅ Extensible (custom tools as React components)
918 | - ✅ Production-ready
919 |
920 | ---
921 |
922 | ## 🤝 Real-World Use Case
923 |
924 | **Scenario**: Debugging a payment flow issue in staging
925 |
926 | 1. **Environment badge** shows you're in staging (not prod!)
927 | 2. **Role badge** confirms you're logged in as "QA"
928 | 3. Tap **Network** to watch API calls in real-time
929 | 4. Open **Storage** to see what's persisted locally
930 | 5. Check **React Query** to inspect cached payment data
931 | 6. Use **Routes** to see the navigation flow
932 | 7. Launch your custom **Payment Debug** tool
933 |
934 | All from one floating menu that follows you through every screen.
935 |
936 | ---
937 |
938 | ## 📝 License
939 |
940 | MIT © Buoy Tools
941 |
942 | ---
943 |
944 | ## 🚀 Learn More
945 |
946 | **Resources**:
947 |
948 | - [Example App](./example) - Full working example with all packages
949 | - [Package Source](./packages) - Individual package source code
950 | - [Changelog](./CHANGELOG.md) - Version history
951 |
952 | **Contributing**:
953 |
954 | - Report bugs: [GitHub Issues](https://github.com/yourusername/react-buoy/issues)
955 | - Feature requests welcome!
956 |
957 | ---
958 |
959 | ## 💙 Credits
960 |
961 | Big thanks to [galaxies.dev](https://galaxies.dev) — their content helped me get up to speed with React Native early on, and I strongly recommend it as a resource for anyone making the jump from web to mobile.
962 |
963 |
964 |
965 |
966 |
--------------------------------------------------------------------------------