A library for converting device IDs to user-friendly model names
npm install @naverpay/device-info
# or
yarn add @naverpay/device-info
# or
pnpm add @naverpay/device-infoimport{ios,aos}from"@naverpay/device-info";console.log(ios["iPhone15,4"]);// 'iPhone 15'console.log(aos["SM-S901B"]);// 'Galaxy S22'Object containing iOS device identifier to model name mappings.
- Type:
Record<string, string> - Example:
iPhone14,2→iPhone 13 Pro
Object containing Android device model to marketing name mappings.
- Type:
Record<string, string> - Example:
SM-G991B→Galaxy S21 5G
import{ios,aos}from"@naverpay/device-info";// iOSconstiosModel=ios["iPhone14,2"]||"Unknown iPhone";// AndroidconstandroidModel=aos["SM-G991B"]||"Unknown Android";functiongetDeviceName(deviceId,platform){if(platform==="ios"){returnios[deviceId]||`Unknown iOS (${deviceId})`;}elseif(platform==="android"){returnaos[deviceId]||`Unknown Android (${deviceId})`;}return"Unknown Device";}Q: How often is the data updated?
A: Device data is updated weekly (every Monday) from official sources.
Q: What if a device ID is not found?
A: The library returns undefined. Always provide a fallback value.
Q: Where does the data come from?
A:
- iOS: The Apple Wiki
- Android: Google Play Supported Devices
MIT