State Inspection
Limelight’s state inspector lets you view, track, and debug your application state in real-time. Connect your Zustand or Redux stores with a single line of code and get full visibility into every state change.
Quick Start
Add your stores to theLimelight.connect() call:
Zustand
Limelight works with Zustand out of the box. Pass your store hooks directly:Vanilla Stores
If you’re using Zustand’s vanilla stores (created withcreateStore instead of create), they work the same way:
Action Names
Limelight automatically infers action names from your code. When you call a function likelogin() that internally calls set(), Limelight captures “login” as the action name.
Action names are inferred from the call stack. If Limelight can’t determine
the name, it falls back to “set”.
Redux
Connect your Redux store the same way:Multiple Stores
You can connect as many stores as you need. Mix Zustand and Redux in the same app:Configuration Options
Disable State Inspection
If you want to connect stores but temporarily disable state inspection:Filter Sensitive Data
Use thebeforeSend hook to filter or modify state before it’s sent to Limelight:
Throttle High-Frequency Updates
For stores that update very frequently (e.g., mouse position, animations), you may want to filter updates:What Gets Captured
For each state change, Limelight captures:| Field | Description |
|---|---|
| Action Type | The name of the function that triggered the change (Zustand) or the action type (Redux) |
| Payload | The data passed to the action (Redux) or the partial state passed to set() (Zustand) |
| State | The full state after the change |
| Diff | Which keys changed and their before/after values |
| Timestamp | When the change occurred |
| Stack Trace | Where in your code the change originated |
Supported Libraries
Zustand
Full support for
create() and createStore(). Action names inferred
automatically.Redux
Full support for Redux Toolkit and vanilla Redux. Captures action types and
payloads.
Support for Jotai, Recoil, and MobX is coming soon. Let us
know which libraries
you’d like to see supported.
Best Practices
Use descriptive store names
Use descriptive store names
The names you pass to
stores appear throughout the Limelight UI. Use names that clearly describe what the store contains:Name your Zustand actions
Name your Zustand actions
Limelight infers action names from your function names. Use clear, descriptive names:
Filter high-frequency updates
Filter high-frequency updates
Stores that update many times per second can flood the timeline. Use
beforeSend to throttle or filter these updates.Redact sensitive data
Redact sensitive data
Never send passwords, tokens, or PII to Limelight. Use
beforeSend to redact sensitive fields before they leave the device.Troubleshooting
Store not appearing in Limelight
Store not appearing in Limelight
- Make sure
Limelight.connect()is called after your store is created - Verify the store is passed correctly to the
storesobject - Check that
enableStateInspectoris not set tofalse - Look for errors in the console starting with
[Limelight]
Actions showing as 'set' instead of function name
Actions showing as 'set' instead of function name
Limelight infers action names from the call stack. If your bundler minifies
function names in development, the names may not be captured correctly.
Solutions: - Ensure your development build doesn’t minify function names -
Use named functions instead of arrow functions for actions
State updates not appearing
State updates not appearing
- Verify the WebSocket connection is established (check for “Connected”
status) 2. Make sure you’re not filtering out the events with
beforeSend3. Check that the state is actually changing (Limelight only captures changes)
Performance impact
Performance impact
Limelight is designed to have minimal performance impact:
- State is captured synchronously but sent asynchronously
- Diffs are computed on the desktop app, not in your app
- The SDK automatically disables itself in production builds
beforeSend to throttle updates.Next Steps
Network Inspection
Debug API requests alongside state changes
Console Logs
View console output with full stack traces