Version 2025-07 is the last API version to support React-based UI components. Later versions use web components, native UI elements with built-in accessibility, better performance, and consistent styling with Shopify's design system. Check out the migration guide to upgrade your extension.
Device API
The Device API provides access to device information and capabilities, allowing you to retrieve device details, check device types, and adapt your extension behavior based on the POS hardware characteristics. The API enables device-aware functionality and responsive design based on device form factors.
Anchor to Use casesUse cases
- Responsive design: Implement responsive design that adapts based on device form factor.
- Device information: Display device-specific information for troubleshooting or support.
- Device-aware features: Customize user experiences based on device capabilities.
- Usage tracking: Track device usage patterns for analytics or optimization.
Supported targets
- pos.
cart. line-item-details. action. menu-item. render - pos.
cart. line-item-details. action. render - pos.
customer-details. action. menu-item. render - pos.
customer-details. action. render - pos.
customer-details. block. render - pos.
draft-order-details. action. menu-item. render - pos.
draft-order-details. action. render - pos.
draft-order-details. block. render - pos.
exchange. post. action. menu-item. render - pos.
exchange. post. action. render - pos.
exchange. post. block. render - pos.
home. modal. render - pos.
home. tile. render - pos.
order-details. action. menu-item. render - pos.
order-details. action. render - pos.
order-details. block. render - pos.
product-details. action. menu-item. render - pos.
product-details. action. render - pos.
product-details. block. render - pos.
purchase. post. action. menu-item. render - pos.
purchase. post. action. render - pos.
purchase. post. block. render - pos.
return. post. action. menu-item. render - pos.
return. post. action. render - pos.
return. post. block. render
Supported targets
- pos.
cart. line-item-details. action. menu-item. render - pos.
cart. line-item-details. action. render - pos.
customer-details. action. menu-item. render - pos.
customer-details. action. render - pos.
customer-details. block. render - pos.
draft-order-details. action. menu-item. render - pos.
draft-order-details. action. render - pos.
draft-order-details. block. render - pos.
exchange. post. action. menu-item. render - pos.
exchange. post. action. render - pos.
exchange. post. block. render - pos.
home. modal. render - pos.
home. tile. render - pos.
order-details. action. menu-item. render - pos.
order-details. action. render - pos.
order-details. block. render - pos.
product-details. action. menu-item. render - pos.
product-details. action. render - pos.
product-details. block. render - pos.
purchase. post. action. menu-item. render - pos.
purchase. post. action. render - pos.
purchase. post. block. render - pos.
return. post. action. menu-item. render - pos.
return. post. action. render - pos.
return. post. block. render
Anchor to PropertiesProperties
The Device API object provides access to device information and capabilities. Access the following properties on the API object to retrieve device details, check device types, and adapt your extension behavior based on POS hardware characteristics.
- Anchor to getDeviceIdgetDeviceIdgetDeviceId() => Promise<string>() => Promise<string>requiredrequired
Retrieves the unique string identifier for the device. Returns a promise that resolves to the device ID. Use for device-specific data storage, analytics tracking, or implementing device-based permissions and configurations.
- Anchor to isTabletisTabletisTablet() => Promise<boolean>() => Promise<boolean>requiredrequired
Determines whether the device is a tablet form factor. Returns a promise that resolves to
truefor tablets,falsefor other device types. Use for implementing responsive design, optimizing touch targets, or providing device-appropriate user experiences.- Anchor to namenamenamestringstringrequiredrequired
The name of the device as configured by the merchant or system. Use for displaying device information in interfaces, logging, or support contexts where device identification is helpful.
- Anchor to registerNameregisterNameregisterNamestringstringrequiredrequired
A short, unique identifier for the device, assigned by Shopify.
Anchor to Best practicesBest practices
- Handle async device queries: Handle the Promise-based device methods with async/await or
.then()patterns, and implement appropriate error handling for device query failures. - Cache device information appropriately: Consider caching device information after the initial query to avoid repeated async calls, but ensure you handle cases where device characteristics might change during the session.
- Provide device-appropriate experiences: Design different user experiences for tablets versus other devices, taking advantage of larger screens while ensuring functionality works across all supported device types.
Anchor to LimitationsLimitations
- Device information queries are asynchronous and may take time to resolve, so always handle the Promise-based responses appropriately in your extension logic.
- The Device API provides read-only access to device information and can't be used to modify device settings or capabilities.
- Device type detection is limited to basic form factor identification (tablet vs. non-tablet) and doesn't provide detailed hardware specifications or capabilities.