Files
headlamp-sealed-secrets-plugin/docs/api-reference/generated/hooks/useControllerHealth/functions/useControllerHealth.md
T
Chris Farhood 46d59b48b5 chore: migrate repository to privilegedescalation organization
Updated all GitHub URLs from cpfarhood to privilegedescalation organization:
- Repository URLs in package.json and Artifact Hub metadata
- Documentation links and references
- Git remote updated

No functional changes - this is purely an organizational migration.

Co-Authored-By: Claude <noreply@anthropic.com>
Co-Authored-By: Happy <yesreply@happy.engineering>
2026-02-12 10:50:30 -05:00

66 lines
1.5 KiB
Markdown

[**Headlamp Sealed Secrets API v0.2.0**](../../../README.md)
***
[Headlamp Sealed Secrets API](../../../README.md) / [hooks/useControllerHealth](../README.md) / useControllerHealth
# Function: useControllerHealth()
> **useControllerHealth**(`autoRefresh?`, `refreshIntervalMs?`): `object`
Defined in: [src/hooks/useControllerHealth.ts:30](https://github.com/privilegedescalation/headlamp-sealed-secrets-plugin/blob/bdf19cd3bf5a2d679b7ba949108fe9df1843c5f4/headlamp-sealed-secrets/src/hooks/useControllerHealth.ts#L30)
Custom hook for monitoring controller health
Automatically checks controller health on mount and can optionally
refresh at a specified interval.
## Parameters
### autoRefresh?
`boolean` = `false`
Whether to automatically refresh health status
### refreshIntervalMs?
`number` = `30000`
Refresh interval in milliseconds (default: 30000ms = 30s)
## Returns
`object`
Object with health status, loading state, and manual refresh function
### health
> **health**: [`ControllerHealthStatus`](../../../lib/controller/interfaces/ControllerHealthStatus.md)
### loading
> **loading**: `boolean`
### refresh()
> **refresh**: () => `Promise`\<`void`\> = `fetchHealth`
#### Returns
`Promise`\<`void`\>
## Example
```ts
// Manual refresh only
const { health, loading, refresh } = useControllerHealth();
// Auto-refresh every 30 seconds
const { health, loading } = useControllerHealth(true, 30000);
// Auto-refresh every 10 seconds
const { health, loading } = useControllerHealth(true, 10000);
```