Plugin Class
WazuhCheckUpdatesPlugin
Location:plugins/wazuh-check-updates/public/plugin.ts:12
Lifecycle Methods
setup()
Initializes the plugin (no setup tasks required). Signature:CoreSetup
required
OpenSearch Dashboards core setup contract
WazuhCheckUpdatesPluginSetup - Empty object
start()
Activates update checking services. Signature:CoreStart
required
OpenSearch Dashboards core start contract
AppPluginStartDependencies
required
Plugin dependencies
WazuhCheckUpdatesPluginStart
React.ComponentType
React component for displaying update notifications
React.ComponentType
React component for dismissing update notifications
Function
Function to retrieve available updates
Public API
getAvailableUpdates()
Retrieves information about available Wazuh updates. Signature:boolean
default:false
Only check if updates exist without fetching details
boolean
default:false
Force a fresh query, bypassing cache
Promise<AvailableUpdates>
string
API host identifier
string
Currently installed Wazuh version
object
Latest available major version
object
Latest available minor version
object
Latest available patch version
Components
UpdatesNotification
Displays update notifications in the UI. Usage:- Automatically checks for updates on mount
- Displays notifications for major, minor, and patch updates
- Provides links to release notes
- Respects user dismissal preferences
DismissNotificationCheck
Allows users to dismiss update notifications. Usage:Server Plugin
The server-side plugin manages update data and user preferences.WazuhCheckUpdatesPlugin (Server)
Location:plugins/wazuh-check-updates/server/plugin.ts:37
setup() (Server)
Signature:- Registers saved object types - For storing update data and user preferences
- Creates router - Sets up HTTP endpoints
- Registers route handler context - Adds
wazuh_check_updatescontext
start() (Server)
Signature:- Creates internal saved objects client - For background operations
- Initializes services - Sets up update checking logic
Server Routes
The plugin exposes REST endpoints for update management.GET /api/v1/wazuh-check-updates/updates
Retrieve available updates. Query Parameters:string
API host ID to check updates for
boolean
default:false
Force fresh update check
POST /api/v1/wazuh-check-updates/dismiss
Dismiss update notifications. Request Body:string
required
Version to dismiss notifications for
string
required
Type of update: “major”, “minor”, or “patch”
GET /api/v1/wazuh-check-updates/preferences
Retrieve user notification preferences. Response:PUT /api/v1/wazuh-check-updates/preferences
Update user notification preferences. Request Body:object
required
Map of dismissed update versions
Request Handler Context
The plugin extends the request handler context. Type Definition:Integration Example
Complete example of integrating update checks:Best Practices
Check Updates on Application Start
Check Updates on Application Start
Check for updates when the application starts, but don’t block the UI:
Respect User Preferences
Respect User Preferences
Always check if the user has dismissed a notification before showing it:
Cache Update Data
Cache Update Data
Avoid checking for updates too frequently. Use the cached data:
Handle Errors Gracefully
Handle Errors Gracefully
Update checks may fail due to network issues. Handle errors without breaking the UI:
Related Resources
Main Plugin
Main dashboard plugin API
Wazuh Core
Core services and configuration
Update Guide
How to upgrade Wazuh
Release Notes
Wazuh release notes