--- title: Device API description: The Device API allows the UI Extension to retrieve device information including the device name and ID. api_version: 2025-10 api_name: pos-ui-extensions source_url: html: https://shopify.dev/docs/api/pos-ui-extensions/latest/apis/device-api md: https://shopify.dev/docs/api/pos-ui-extensions/latest/apis/device-api.md --- # Device APIAPIs The Device API allows the UI Extension to retrieve device information including the device name and ID. ## DeviceApi * getDeviceId () => Promise\ required The string ID of the device * isTablet () => Promise\ required Whether the device is a tablet * name string required The name of the device ## Examples Examples of using the Device API. Retrieve name of the device. Retrieve the ID of the device. Check if device is a tablet. ### Examples * #### Retrieve name of the device. ##### jsx ```jsx import {render} from 'preact'; export default async () => { render(, document.body); }; const Extension = () => { return ( ); }; ``` * #### Retrieve the ID of the device. ##### jsx ```jsx import {render} from 'preact'; import {useState} from 'preact/hooks'; export default async () => { render(, document.body); }; const Extension = () => { const [deviceId, setDeviceId] = useState(''); shopify.device.getDeviceId().then((deviceId) => { setDeviceId(deviceId); }); return ( ); }; ``` * #### Check if device is a tablet. ##### jsx ```jsx import {render} from 'preact'; import {useState} from 'preact/hooks'; export default async () => { render(, document.body); }; const Extension = () => { const [isTablet, setIsTablet] = useState(false); shopify.device.isTablet().then((isTablet) => { setIsTablet(isTablet); }); return ( ); }; ```