Skip to main content
sunpeak API

Overview

The useDeviceCapabilities hook returns the device input capabilities reported by the host. It is a convenience wrapper around useHostContext.

Wraps onhostcontextchanged

MCP Apps SDK reference

Import

Signature

Returns

return
DeviceCapabilities
Device input capabilities reported by the host:
Returns an empty object {} if the host does not report capabilities.

Usage

The device capabilities come from McpUiHostContext.deviceCapabilities.
For browser-level detection outside of React or when host context is unavailable, sunpeak also exports isPrimarilyTouchDevice and isHoverAvailable utility functions.