A comprehensive realtime debugging and monitoring tool for Supabase applications. Monitor channels, broadcast messages, track database changes, analyze connection statistics, and debug realtime subscriptions with an intuitive three-tab developer interface.
- Monitor Tab: Real-time channel monitoring with live logs
- Stats Tab: Comprehensive connection statistics and message analytics
- Settings Tab: Full configuration control with persistent settings
- Multi-Event Support: Monitor broadcast, database changes, and presence events
- Real-time Connection Status: Visual indicators with animated status badges
- Channel Subscription Management: Start/stop monitoring with instant feedback
- Auto-Reconnection: Handles connection drops gracefully
- Authentication Awareness: Monitors Supabase auth state in real-time
- Categorized Logs: Success, Error, Warning, and Info messages with color-coded icons
- Source Tracking: Distinguish between broadcast, database, presence, system, and self-generated events
- Expandable Details: Click to view full JSON payloads with syntax highlighting
- Smart Filtering: Toggle system logs visibility, auto-scroll controls
- Persistent History: Configurable log retention (10-1000 entries)
- Live Timestamps: Millisecond-precision timestamps for debugging
- Connection Metrics: Real-time connection status, uptime tracking, last activity
- Message Analytics: Total messages, per-type counters, message distribution graphs
- Performance Tracking: Activity monitoring with visual progress indicators
- Channel Information: Current channel details with tooltip support
- Log Statistics: Total vs filtered log counts, retention settings
- Event Listeners: Granular control over broadcast, database, and presence events
- Self-Test Broadcasting: Send test messages to verify channel functionality
- Display Options: System log visibility, auto-scroll behavior, log limits
- Persistent Settings: Local storage for all configuration with reset functionality
- Keyboard Shortcuts: Customizable hotkeys with user-defined combinations
- Responsive Design: Optimized for development workflows with full-screen interface
- Visual Indicators: Color-coded status badges, animated connection states
- Smooth Interactions: Polished animations, hover effects, and transitions
- Accessibility: Keyboard navigation, screen reader support, tooltip guidance
- Performance Optimized: Memoized components, reducer-based state management
- Real-time Auth Status: Monitors Supabase session state continuously
- Visual Auth Indicators: Clear status badges for connection state
- Error Handling: Graceful degradation with informative error messages
- Session Management: Automatic session detection and validation
- Optimized Rendering: Memoized components prevent unnecessary re-renders
- State Management: Reducer-based architecture for predictable state updates
- Memory Management: Automatic log cleanup and efficient data structures
- Error Boundaries: Graceful error handling with detailed error reporting
Make sure you have:
- ✅ Node.js installed (download here)
- ✅ Your own project with shadcn/ui already set up
- ✅ Two terminal windows available
Step 1: Get This Project Running on Your Computer
- Download this project to your computer:
git clone https://github.com/yourusername/supabase-realtime-dev-tools.git
cd supabase-realtime-dev-tools- Install the project's dependencies:
npm install- Start the project (this creates a local server):
npm run dev- Wait for it to start - you'll see a message like:
▲ Next.js 15.1.4
- Local: http://localhost:3000
Step 2: Install the Component in Your Project
-
Open a new terminal window (keep the first one running!)
-
Go to your own project folder where you want to use the component:
cd /path/to/your-project
# Example: cd ~/Desktop/my-nextjs-app
# Or: cd C:\Users\YourName\my-react-project- Install the component from your local server:
npx shadcn@latest add http://localhost:3000/r/supabase-realtime-dev-tools.json- That's it! The component is now installed in your project.
Important: Keep the first terminal running (from Step 4) until you finish installing the component. After installation, you can stop it with
Ctrl+C.
Visual Guide:
Terminal 1 (Keep Running) Terminal 2 (Your Commands)
┌─────────────────────────┐ ┌─────────────────────────┐
│ supabase-dev-tools/ │ │ your-project/ │
│ $ npm run dev │ │ $ cd /path/to/your-proj │
│ ▲ Next.js running... │ ───► │ $ npx shadcn add http://│
│ Local: localhost:3000 │ │ localhost:3000/r/... │
└─────────────────────────┘ └─────────────────────────┘
Common Issues:
- ❌ "Cannot connect to localhost:3000" → Make sure Terminal 1 is still running with
npm run dev - ❌ "Command not found: npx" → Install Node.js from nodejs.org
- ❌ "shadcn not found" → Make sure you're in a project that already has shadcn/ui set up
- Install Dependencies:
npm install @supabase/supabase-js lucide-react @radix-ui/react-scroll-area @radix-ui/react-switch @radix-ui/react-tabs @radix-ui/react-tooltip class-variance-authority- Copy the Component:
# Create the component directory
mkdir -p src/components/ui
# Copy the component file
curl -o src/components/ui/supabase-realtime-dev-tools.tsx \
https://raw.githubusercontent.com/yourusername/supabase-realtime-dev-tools/main/registry/new-york/supabase-realtime-dev-tools/supabase-realtime-dev-tools.tsx- Install Required UI Components:
npx shadcn@latest add button input badge card scroll-area switch tabs tooltip textarea labelimport SupabaseDevTools from "@/components/ui/supabase-realtime-dev-tools";
export default function App() {
return (
<div>
{/* Your app content */}
<SupabaseDevTools />
</div>
);
}import SupabaseDevTools from "@/components/ui/supabase-realtime-dev-tools";
import { createClient } from "@supabase/supabase-js";
const supabase = createClient(
process.env.NEXT_PUBLIC_SUPABASE_URL!,
process.env.NEXT_PUBLIC_SUPABASE_ANON_KEY!
);
export default function App() {
return (
<div>
{/* Your app content */}
<SupabaseDevTools
client={supabase}
position="top-left"
defaultChannel="my-project-channel"
maxLogs={200}
keyboardShortcut="Ctrl+Alt+D"
enableKeyboardShortcut={true}
autoShow={false}
/>
</div>
);
}The component automatically detects Supabase clients:
// Option 1: Pass client explicitly
<SupabaseDevTools client={supabase} />
// Option 2: Global detection (window.supabase or window.__supabase)
<SupabaseDevTools />| Prop | Type | Default | Description |
|---|---|---|---|
client |
SupabaseClient |
undefined |
Your Supabase client instance |
position |
"bottom-right" | "bottom-left" | "top-right" | "top-left" |
"bottom-right" |
DevTools panel position |
defaultChannel |
string |
"devtools-monitor" |
Initial channel name |
maxLogs |
number |
200 |
Maximum number of log entries |
enableKeyboardShortcut |
boolean |
true |
Enable keyboard shortcut |
keyboardShortcut |
string |
"Ctrl+Shift+D" |
Keyboard shortcut to toggle |
autoShow |
boolean |
false |
Auto-show DevTools on component mount |
The Monitor tab is your command center for real-time debugging:
- Start/Stop Monitoring: Connect to any Supabase channel with real-time status
- Channel Input: Type any channel name to monitor
- Connection Status: Visual indicators show connection state with animated badges
- Test Broadcasting: Send test messages to verify channel functionality
- Real-time Events: See all channel activity as it happens
- Event Categorization: Broadcast, Database, Presence, System, and Self events
- Expandable Details: Click any log entry to see full JSON payload
- Smart Filtering: Toggle system logs, auto-scroll controls
| Badge Color | Source | Description |
|---|---|---|
| 🟢 Green | Broadcast | Broadcast events from other clients |
| 🟣 Purple | Database | Database changes (INSERT, UPDATE, DELETE) |
| 🔵 Blue | Presence | Presence events (joins, leaves, updates) |
| 🔵 Blue | Self | Messages you sent (test broadcasts) |
| ⚫ Gray | System | DevTools internal messages |
| Status Badge | Description |
|---|---|
| 🟢 Connected | Connected and authenticated |
| 🔴 Disconnected | Not connected or auth failed |
| 🟢 Monitoring | Actively monitoring channel |
| 🔴 Auth Error | Authentication issue |
Comprehensive analytics for your realtime connections:
- Real-time Status: Current connection state and monitoring status
- Channel Information: Active channel name with tooltip details
- Activity Tracking: Last activity timestamp and uptime metrics
- Total Messages: Complete count of all received messages
- Per-Type Counters: Separate counts for broadcast, database, presence, system events
- Message Distribution: Visual progress bars showing message type ratios
- Log Statistics: Total vs filtered log counts with retention settings
- Connection Health: Monitor connection stability and performance
- Activity Monitoring: Track message frequency and patterns
- Memory Usage: Log count management and cleanup statistics
Full configuration control with persistent settings:
- Broadcast Events: Toggle broadcast message monitoring
- Database Changes: Enable/disable postgres_changes listener
- Presence Events: Control presence event monitoring
- Self-Test Broadcasting: Allow sending test messages
- System Logs: Show/hide DevTools internal messages
- Auto-Scroll: Automatically scroll to new log entries
- Max Logs: Set log retention limit (10-1000 entries)
- Version Display: Current DevTools version
- Keyboard Shortcut: Shows configured hotkey
- Supabase Status: Client connection status with debug info
- Reset Settings: Restore all settings to defaults
The DevTools automatically handles authentication:
- Session Detection: Automatically detects active Supabase sessions
- Real-time Monitoring: Continuously monitors auth state changes
- Visual Feedback: Clear status indicators for auth state
- Error Handling: Graceful degradation with informative error messages
- Reconnection: Automatic reconnection when auth is restored
- Memoized Components: Prevent unnecessary re-renders
- Reducer Architecture: Predictable state management
- Debounced Updates: Smooth scrolling and UI updates
- Memory Management: Automatic log cleanup and efficient data structures
Monitor custom broadcast messages:
// In your app - sending broadcasts
const channel = supabase.channel("my-channel");
channel.send({
type: "broadcast",
event: "custom-event",
payload: { message: "Hello World" },
});
// DevTools will show:
// 📻 Broadcast: custom-event
// Click to expand full payloadMonitor postgres_changes events:
// In your app - database subscription
const channel = supabase.channel("db-changes").on(
"postgres_changes",
{
event: "*",
schema: "public",
table: "posts",
},
(payload) => {
console.log("Change received!", payload);
}
);
// DevTools will show:
// 🗄️ DB INSERT: posts
// 🗄️ DB UPDATE: posts
// 🗄️ DB DELETE: postsMonitor user presence:
// In your app - presence tracking
const channel = supabase
.channel("online-users")
.on("presence", { event: "sync" }, () => {
console.log("Presence synced");
})
.on("presence", { event: "join" }, ({ key, newPresences }) => {
console.log("User joined", newPresences);
});
// DevTools will show:
// 👥 Presence: sync
// 👥 Presence: join
// 👥 Presence: leave- Node.js 18+ and npm/pnpm
- Supabase project with realtime enabled
- Clone the Repository:
git clone https://github.com/yourusername/supabase-realtime-dev-tools.git
cd supabase-realtime-dev-tools- Install Dependencies:
npm install
# or
pnpm install- Run the Development Server:
npm run dev
# or
pnpm dev- Open in Browser:
open http://localhost:3000supabase-realtime-dev-tools/
├── app/ # Next.js app directory
│ ├── page.tsx # Demo page
│ └── layout.tsx # Root layout
├── components/ # Reusable components
│ ├── ui/ # shadcn/ui components
│ └── providers.tsx # Context providers
├── registry/ # Component registry
│ └── new-york/
│ └── supabase-realtime-dev-tools/
│ └── supabase-realtime-dev-tools.tsx
├── public/ # Static assets
│ └── r/ # Registry definitions
│ └── supabase-realtime-dev-tools.json
├── lib/ # Utility functions
└── package.json
- Hot Reload: Instant updates during development
- TypeScript: Full type safety and IntelliSense
- ESLint: Code quality and consistency
- Tailwind CSS: Utility-first styling
- Component Registry: Easy distribution system
We welcome contributions! Here's how to get started:
- Fork the Repository
- Create a Feature Branch:
git checkout -b feature/amazing-feature-
Make Your Changes:
- Follow the existing code style
- Add TypeScript types for new features
- Update tests if applicable
- Test across different browsers
-
Test Your Changes:
npm run dev
# Test the component thoroughly
# Try different Supabase configurations
# Test keyboard shortcuts and UI interactions- Submit a Pull Request:
- Describe your changes clearly
- Include screenshots/videos for UI changes
- Reference any related issues
- Add tests for new functionality
- TypeScript: Use strict typing with readonly interfaces
- React: Functional components with hooks, memoization for performance
- Styling: Tailwind CSS classes, consistent spacing and colors
- Components: shadcn/ui patterns, accessible design
- State Management: Reducer pattern for complex state
- Performance: Memoized components, debounced actions
- 🐛 Bug Fixes: Report and fix issues, improve error handling
- ✨ New Features: Export logs, custom themes, advanced filtering
- 📊 Analytics: Enhanced statistics, performance metrics
- 📚 Documentation: Improve guides, add examples, video tutorials
- 🎨 UI/UX: Design improvements, accessibility enhancements
- 🔧 Developer Experience: Better TypeScript support, testing utilities
- 🌐 Internationalization: Multi-language support
- 🔌 Integrations: Support for other realtime services
The component uses Tailwind CSS and shadcn/ui. Customize by:
- Modifying CSS Variables:
:root {
--primary: your-primary-color;
--secondary: your-secondary-color;
--muted: your-muted-color;
--border: your-border-color;
/* ... other CSS variables */
}- Custom Positioning:
import SupabaseDevTools from "@/components/ui/supabase-realtime-dev-tools";
import { cn } from "@/lib/utils";
export function CustomDevTools(props) {
return (
<div
className={cn(
"fixed top-0 left-0 w-full h-full z-[9999]",
props.className
)}
>
<SupabaseDevTools {...props} />
</div>
);
}- Theme Integration:
// Integrate with your theme system
import { useTheme } from "next-themes";
export function ThemedDevTools() {
const { theme } = useTheme();
return (
<div className={cn("supabase-devtools", theme === "dark" && "dark")}>
<SupabaseDevTools />
</div>
);
}- Custom Log Processing:
// Fork the component and modify log handling
const customAddLog = useCallback((type, message, source, details) => {
// Add custom processing
const processedMessage = customProcessor(message);
const enrichedDetails = { ...details, customData: getCustomData() };
// Original log logic
dispatch({
type: "ADD_LOG",
payload: {
type,
message: processedMessage,
source,
details: enrichedDetails,
},
});
}, []);- Advanced Event Handling:
// Add custom event listeners
const channel = supabase
.channel(channelName)
.on("broadcast", { event: "custom-event" }, (payload) => {
// Custom handling for specific events
addLog("info", `Custom event: ${payload.type}`, "broadcast", payload);
})
.on(
"postgres_changes",
{
event: "*",
schema: "public",
table: "specific_table",
},
(payload) => {
// Table-specific handling
addLog("success", `Table update: ${payload.table}`, "database", payload);
}
);- Custom Configuration:
// Extend the configuration interface
interface CustomConfig extends DevToolsConfig {
customSetting: boolean;
advancedOptions: Record<string, any>;
}
// Use with custom settings
const [customConfig, setCustomConfig] = useState<CustomConfig>({
...DEFAULT_CONFIG,
customSetting: true,
advancedOptions: { feature: true },
});- React: 18.0.0 or higher
- TypeScript: 5.0.0 or higher
- Supabase JS: 2.0.0 or higher
- Node.js: 18.0.0 or higher
- @supabase/supabase-js: ^2.0.0
- react: ^18.0.0
- react-dom: ^18.0.0
- lucide-react: ^0.263.0
- class-variance-authority: ^0.7.0
- Next.js: 13.0.0 or higher (for demo)
- Tailwind CSS: 3.0.0 or higher
- shadcn/ui: Latest version
- TypeScript: 5.0.0 or higher
- Chrome: Latest 2 versions
- Firefox: Latest 2 versions
- Safari: Latest 2 versions
- Edge: Latest 2 versions
- Local Storage: Settings are stored locally, no sensitive data transmission
- Authentication: Uses existing Supabase session, no credential storage
- Network: Only connects to configured Supabase instances
- Privacy: No external analytics or tracking
- Environment Variables: Store Supabase credentials securely
- Channel Names: Use descriptive, non-sensitive channel names
- Development Only: Remove from production builds
- Access Control: Ensure proper RLS policies on monitored tables
MIT License - see LICENSE file for details.
- Built with shadcn/ui for consistent, accessible components
- Icons by Lucide React for clear, professional iconography
- Powered by Supabase for realtime capabilities
- Inspired by browser DevTools and modern debugging practices
- 🐛 Bug Reports: GitHub Issues
- 💡 Feature Requests: GitHub Discussions
- 📖 Documentation: Wiki
- 💬 Community: Discord - #realtime-devtools channel
Q: Can I use this in production? A: The DevTools are designed for development. Consider removing or conditionally rendering based on environment.
Q: Does it work with Supabase Edge Functions? A: Yes! Monitor Edge Function broadcasts and database changes triggered by functions.
Q: How do I monitor multiple channels? A: Currently supports one channel at a time. You can quickly switch channels in the Monitor tab.
Q: Can I export the logs? A: Log export is planned for a future release. Currently, you can copy log details manually.
Q: Does it support custom event types? A: Yes! Any broadcast event type will be displayed with proper categorization.
Happy debugging! 🐛✨