Salesforce Event Subscriber
Real-time Salesforce Platform Events, Change Data Capture (CDC), and streaming API monitoring directly in VS Code.

🎯 Overview
The Salesforce Event Subscriber is a Visual Studio Code extension that allows you to manage and interact with Salesforce platform events and streaming APIs directly from your workspace. Monitor events from multiple Salesforce orgs simultaneously with powerful filtering, search, and observability features.
✨ What's New in v0.5.0
- Channel Discovery: Click "+" and browse all available events from your org — no more typing channel names manually
- Categorized List: Channels organized into Custom Platform Events, Standard Platform Events, Change Data Capture, PushTopics, and Streaming Channels
- Default Org Auto-Detection: Instantly connects to your default org (fast: 2 CLI calls)
- Auto-Subscribe: Channels are subscribed automatically after being added
- Progress Indicators: Visual feedback during org detection and channel fetching
- Visible Add/Dashboard Buttons: "+" and dashboard icons now shown directly in the title bar
- 83 Unit Tests: Comprehensive test coverage
Previous Releases
- v0.4.0: Multi-org support for simultaneous monitoring across orgs
- v0.3.0: Observability dashboard with event metrics and subscription health
- v0.2.0: Real-time event filtering (text, regex, JSON path) and event search
- v0.1.0: Event replay, jsforce 3.10.8 upgrade, automated testing
🚀 Features
This extension provides an interface within VS Code to:
- Channel Discovery: Browse all available events from your org in a categorized list — no manual typing needed
- Auto-Subscribe: Channels are subscribed immediately after being added
- Multi-Org Support: Monitor events from multiple Salesforce orgs simultaneously
- Default Org Detection: Automatically connects to your default org for fast channel browsing
- Subscribe to Events: Subscribe and unsubscribe from Platform Events, CDC, and streaming topics
- Event Replay: Track ReplayIds and replay missed events from the last 72 hours
- Real-time Filtering: Filter events as they arrive using text search, regex patterns, or JSON path expressions
- Event Search: Search through historical events (last 500 per subscription) with multiple search options
- Observability Dashboard: View comprehensive metrics including event rates, totals, uptime, and filter statistics
- Real-time Monitoring: View event data in real-time using VS Code's Output Channel
- Multiple Subscriptions: Manage multiple event subscriptions across different orgs
- Persistent State: Remember your subscriptions, org credentials, and last ReplayIds across sessions
- Pretty-printed Output: JSON event data formatted for easy reading
Supported Event Types
- ✅ Platform Events:
/event/EventName__e
- ✅ Change Data Capture (CDC):
/data/ChangeEventName
- ✅ Streaming Topics:
/topic/TopicName
- ✅ Generic Streaming: Any Salesforce streaming channel
📦 Installation
From VS Code Marketplace
- Open Visual Studio Code
- Press
Ctrl+P (or Cmd+P on Mac) to open the Quick Open dialog
- Type
ext install nagendra080389.event-subscriber
- Click Install
From Source
- Clone this repository
- Run
npm install
- Run
npm run compile
- Press
F5 to launch the extension in debug mode
📋 Requirements
- Visual Studio Code v1.75.0 or higher
- Salesforce CLI (
sf CLI)
- Authenticated Salesforce Org with streaming API access
🎮 Usage
Connecting to Salesforce Org
After installing the extension, the Salesforce Event Subscriber panel appears in the Activity Bar. Expand the Org's Data tree to view your connected Salesforce org information:
- Access Token (hidden by default)
- API Version
- Connected Status
- Org ID
- Instance URL
- Username
Managing Event Subscriptions
Add a Channel
- Click the "+" icon in the Channel List title bar
- The extension fetches all available channels from your default org
- Browse and select from the categorized list:
- Custom Platform Events:
/event/MyEvent__e
- Standard Platform Events:
/event/LoginEvent, /event/LogoutEvent, etc.
- Change Data Capture:
/data/AccountChangeEvent
- PushTopics:
/topic/MyTopic
- Streaming Channels:
/u/MyChannel
- The channel is automatically subscribed — no extra click needed
You can also select "Enter channel name manually..." to type a custom channel path, or "Use a different org..." to browse channels from another org.
View Event Messages
- Right-click on a subscribed channel
- Select "Show Output Channel"
- Real-time events appear in a dedicated output channel
Replay Events from ReplayId
- Right-click on a subscribed channel
- Select "Replay from ReplayId"
- Enter a ReplayId:
-1: Latest events (default)
-2: All stored events (past 72 hours)
- Specific number: Replay from that ReplayId
Delete a Subscription
- Right-click on a channel
- Click the delete icon or select "Delete"
- Confirm to unsubscribe and remove
Commands
The extension provides the following commands:
| Command |
Description |
eventNames.addChannel |
Add a new event subscription |
eventNames.runNodeCommand |
Subscribe to the selected event |
eventNames.deleteNode |
Unsubscribe and remove the event |
eventNames.showOutputChannel |
Display the event output channel |
eventNames.replayFromId |
Replay events from a specific ReplayId |
eventNames.setFilter |
Set a filter to show only matching events |
eventNames.clearFilter |
Clear the active filter |
eventNames.searchEvents |
Search through event history |
eventNames.showDashboard |
Display observability dashboard with metrics |
orgData.showData |
Show sensitive org data (access token, auth URL) |
🏢 Multi-Org Support
The extension supports monitoring events from multiple Salesforce orgs simultaneously. Each subscription can be connected to a different org.
How It Works
- Org Detection: The extension automatically detects all authenticated Salesforce orgs using
sf org list --all
- Org Selection: When creating a new subscription, you'll be prompted to select which org to use
- Org Persistence: Each subscription remembers its org and automatically reconnects to the correct org
- Org Indicators: The tree view shows which org each subscription belongs to with a 🏢 icon
Usage Examples
Example 1: Monitoring Events from Two Different Orgs
Channel List:
/event/OrderEvent__e 🏢 production-org | Last: 12345678
/event/OrderEvent__e 🏢 sandbox-org | Last: 98765432
/data/AccountChangeEvent 🏢 production-org
Example 2: Setting Up Multi-Org Subscriptions
- Click "+" to add a channel
- Browse channels from your default org, or select "Use a different org..."
- Pick a channel from the categorized list (e.g.,
/event/OrderEvent__e)
- The subscription is created and auto-subscribed to the selected org
Example 3: Working with Multiple Scratch Orgs
- Great for comparing event behavior across environments
- Monitor the same event in dev, QA, and production simultaneously
- Each subscription maintains its own event history and filters
Prerequisites
Authenticate to multiple orgs using Salesforce CLI:
# Authenticate to production org
sf org login web --alias production-org
# Authenticate to sandbox org
sf org login web --alias sandbox-org --instance-url https://test.salesforce.com
# Verify all orgs
sf org list
Features Per-Org
Each subscription maintains its own:
- ✅ Connection credentials (access token, instance URL)
- ✅ Event history (last 500 events)
- ✅ Filters and search results
- ✅ ReplayId tracking
- ✅ Event metrics (event rate, uptime, etc.)
Best Practices
- Use Org Aliases: Set meaningful aliases for your orgs for easy identification
- Group by Org: Keep subscriptions from the same org together for easier management
- Dashboard Monitoring: Use the observability dashboard to compare metrics across orgs
- Consistent Channels: Use the same channel names across orgs to compare behavior
🔄 Event Replay Feature
The extension automatically tracks the ReplayId of every received event. This allows you to:
- Resume after disconnection: Pick up where you left off
- Debug past events: Replay events from the last 72 hours
- Test event handlers: Re-run events without triggering them again
ReplayId Display: Each channel shows its last ReplayId in the tree view:
/event/OrderEvent__e (Last: 12345678)
How to Use:
- Right-click on any channel → "Replay from ReplayId"
- Choose:
- Use the pre-filled last ReplayId
- Enter
-1 for latest events
- Enter
-2 for all stored events
- Enter a specific ReplayId number
🔍 Event Filtering & Search
The extension provides powerful filtering and search capabilities to help you work with high-volume event streams.
Real-time Event Filtering
Filter events as they arrive to focus on what matters:
- Right-click on a subscribed channel
- Select "Set Filter"
- Choose filter type:
- Text Search: Find events containing specific text (case-insensitive)
- JSON Path: Filter by specific field values (e.g.,
payload.Status__c = "Active")
- Regex Pattern: Use regular expressions for complex pattern matching
Filter Indicators: Active filters are shown in the tree view:
/event/OrderEvent__e (Last: 12345678 | 🔍 Filtered (15 hidden))
Clear Filter: Right-click on a channel → "Clear Filter" to remove the filter and see all events again.
Search Event History
Search through the last 500 events for each subscription:
- Right-click on a subscribed channel
- Select "Search Events"
- Choose search type:
- Text Search: Find specific text in events
- JSON Path: Search by field value (e.g., find all events where
payload.Amount__c = "1000")
- Show All Events: Display complete event history
- Show Filtered Events: View events that were filtered out
Search results appear in a dedicated output channel with timestamps and full event data.
Filter Examples
Example 1: Filter by text
- Type: Text Search
- Pattern:
error
- Result: Only shows events containing the word "error"
Example 2: Filter by field value
- Type: JSON Path
- Field:
payload.Status__c
- Value:
Active
- Result: Only shows events where Status__c equals "Active"
Example 3: Filter by field existence
- Type: JSON Path
- Field:
sobject.AccountId
- Value: (leave empty)
- Result: Only shows events that have an AccountId field
Example 4: Regex pattern
- Type: Regex Pattern
- Pattern:
^.*ERROR.*$
- Result: Shows events containing "ERROR" anywhere in the message
📊 Observability Dashboard
The extension provides a comprehensive observability dashboard to monitor the health and performance of your event subscriptions.
Viewing the Dashboard
Click the "Show Observability Dashboard" button in the Channel List title bar, or run the command from the Command Palette (Ctrl+Shift+P → "Show Observability Dashboard").
Dashboard Sections
1. Overall Statistics
- Total Subscriptions: Number of configured channels
- Active Subscriptions: Currently subscribed channels
- Total Events Received: Cumulative events across all channels
- Matched Events: Events that passed filters
- Filtered Events: Events that were filtered out
- Combined Event Rate: Total events per minute across all channels
2. Channel Statistics (Per Subscription)
- Status: Active (🟢) or Inactive (⚫)
- Filter: Shows if filtering is enabled (🔍) or all events shown (📊)
- Total Events: Total events received for this channel
- Matched Events: Events displayed (passed filter)
- Filtered Events: Events hidden by filter
- Event Rate: Events per minute for this channel
- Uptime: How long the subscription has been active
- Last Event: Time since last event was received
- Last ReplayId: Most recent ReplayId received
3. Active Filters
- Shows details of all active filters
- Filter type, pattern/field, and hidden event count
Use Cases
1. Performance Monitoring: Track event rates to identify high-volume channels or unusual activity spikes
2. Subscription Health: Monitor uptime and last event time to detect stale subscriptions
3. Filter Effectiveness: Review filtered event counts to ensure filters are not too restrictive
4. Debugging: Identify which channels are receiving events and at what rate
5. Capacity Planning: Analyze event volumes to plan for scaling or optimization
Dashboard Example
════════════════════════════════════════════════════════════════════════════════
SALESFORCE EVENT SUBSCRIBER - OBSERVABILITY DASHBOARD
════════════════════════════════════════════════════════════════════════════════
Generated: 1/15/2025, 3:45:22 PM
────────────────────────────────────────────────────────────────────────────────
OVERALL STATISTICS
────────────────────────────────────────────────────────────────────────────────
Total Subscriptions: 3
Active Subscriptions: 2
Total Events Received: 1,247
Matched Events: 1,102
Filtered Events: 145
Combined Event Rate: 12.5 events/minute
────────────────────────────────────────────────────────────────────────────────
CHANNEL STATISTICS
────────────────────────────────────────────────────────────────────────────────
1. /event/OrderEvent__e
Status: 🟢 Active
Filter: 🔍 Filtered
Total Events: 856
Matched Events: 711
Filtered Events: 145
Event Rate: 8.5 events/minute
Uptime: 1h 40m
Last Event: 2 seconds ago
Last ReplayId: 12345678
2. /data/AccountChangeEvent
Status: 🟢 Active
Filter: 📊 All Events
Total Events: 391
Matched Events: 391
Filtered Events: 0
Event Rate: 4.0 events/minute
Uptime: 1h 38m
Last Event: 15 seconds ago
🛠️ Configuration
Multi-threaded CLI Execution (Optional)
Enable multi-threaded execution of Salesforce CLI commands:
{
"vsCodeStreamingSubscriber.enableMultithread": true
}
Note: This is experimental and disabled by default.
🧪 Development & Testing
This extension includes comprehensive automated tests:
# Install dependencies
npm install
# Run tests
npm test
# Run tests with coverage
npm run test:coverage
# Compile TypeScript
npm run compile
# Watch mode for development
npm run watch
Test Coverage: 83 unit tests covering all core modules with Jest.
🐛 Known Issues
- Large Event Volumes: Very high-frequency events may cause UI lag. Use filtering for better performance.
If you discover bugs or have feature requests, please open an issue on GitHub.
🗺️ Roadmap
Planned features for future releases:
- 🔌 Pub/Sub API Support: Modern Salesforce streaming with gRPC
- 📊 Event Visualization: Charts and graphs for event data
- 📤 Export Functionality: Export events as CSV or JSON
- ⏸️ Pause/Resume: Pause and resume subscriptions without unsubscribing
See GitHub Issues for detailed roadmap.
📚 Additional Documentation
🤝 Contributing
Contributions are welcome! Please feel free to submit a Pull Request.
- Fork the repository
- Create your feature branch (
git checkout -b feature/amazing-feature)
- Commit your changes (
git commit -m 'Add amazing feature')
- Push to the branch (
git push origin feature/amazing-feature)
- Open a Pull Request
📄 License
This project is licensed under the MIT License - see the LICENSE file for details.
👤 Author
Nagendra Singh
⚠️ Disclaimer
This extension is not an official Salesforce product. It is an independent tool created to streamline Salesforce streaming API development in VS Code.
🎥 Demo

Built with ❤️ for the Salesforce Developer Community