{"id":16935,"library":"webvr-polyfill-dpdb","title":"WebVR Polyfill Device Parameter Database","description":"webvr-polyfill-dpdb is a JSON dataset containing device parameters crucial for the webvr-polyfill. It provides information like screen DPI, bezel width, and device identification rules (User-Agent, resolution, etc.) for various Android and iOS devices. This data is essential for the webvr-polyfill to accurately render stereoscopic scenes by correcting lens distortion on mobile devices, bridging the gap where web applications lack direct access to physical device characteristics. The package is currently at version 1.0.18, with its last recorded update in December 2020. Given that the underlying WebVR API has been deprecated in favor of WebXR, this database is largely superseded and serves a legacy purpose.","status":"abandoned","version":"1.0.18","language":"javascript","source_language":"en","source_url":"https://github.com/WebVRRocks/webvr-polyfill-dpdb","tags":["javascript"],"install":[{"cmd":"npm install webvr-polyfill-dpdb","lang":"bash","label":"npm"},{"cmd":"yarn add webvr-polyfill-dpdb","lang":"bash","label":"yarn"},{"cmd":"pnpm add webvr-polyfill-dpdb","lang":"bash","label":"pnpm"}],"dependencies":[],"imports":[{"note":"This package is a data source. The primary 'import' is to directly access the JSON file containing the device parameter database. Modern bundlers (Webpack, Rollup, Parcel) can handle direct JSON imports. For Node.js, `require()` can load JSON directly.","wrong":"import { dpdb } from 'webvr-polyfill-dpdb';","symbol":"dpdb.json","correct":"import dpdb from 'webvr-polyfill-dpdb/dpdb.json';"},{"note":"The raw, human-editable version of the DPDB is `dpdb-formatted.json`. This is typically used for development or custom builds, while `dpdb.json` is the generated output. Ensure your build system supports JSON imports.","wrong":"import { formattedDpdb } from 'webvr-polyfill-dpdb';","symbol":"dpdb-formatted.json","correct":"import formattedDpdb from 'webvr-polyfill-dpdb/dpdb-formatted.json';"}],"quickstart":{"code":"import dpdb from 'webvr-polyfill-dpdb/dpdb.json';\n\n// In a real application, you would pass this data to the webvr-polyfill\n// for its configuration. This example demonstrates accessing the data directly.\n\nconsole.log('Total devices in DPDB:', dpdb.devices.length);\n\n// Find a specific device entry, for example, based on a User-Agent rule\nconst searchUA = 'ASUS_Z00AD';\nconst asusDevice = dpdb.devices.find(device =>\n  device.rules.some(rule => rule.ua && rule.ua.includes(searchUA))\n);\n\nif (asusDevice) {\n  console.log(`Found device: ASUS_Z00AD with DPI ${asusDevice.dpi} and bezel width ${asusDevice.bw}mm.`);\n} else {\n  console.log(`Device with UA '${searchUA}' not found in DPDB.`);\n}\n\n// Example of accessing a device from the raw formatted JSON (if available/desired)\n// This would typically involve a separate build step or direct file access for customization\n/*\nfetch('node_modules/webvr-polyfill-dpdb/dpdb-formatted.json')\n  .then(response => response.json())\n  .then(formattedData => {\n    console.log('Example from formatted DPDB:', formattedData.devices[0]);\n  });\n*/","lang":"javascript","description":"Demonstrates how to import the `dpdb.json` data and programmatically access device parameters. This package primarily provides data, not executable functions."},"warnings":[{"fix":"Migrate immersive web projects to the WebXR Device API and use `webxr-polyfill` if polyfilling is needed. The `webvr-polyfill-dpdb` is not compatible with WebXR directly.","message":"The underlying WebVR API for which this database was designed has been deprecated and largely replaced by the WebXR Device API. Modern immersive web experiences should target WebXR.","severity":"breaking","affected_versions":">=1.0.0"},{"fix":"For `webvr-polyfill` applications, if you need to support newer devices, you would need to fork this repository, add the device parameters to `dpdb-formatted.json`, run `npm run build`, and use your custom-built `dpdb.json`. However, it's strongly recommended to migrate to WebXR.","message":"The device parameter database (`dpdb.json`) may be outdated. The last known update to this repository was in December 2020. Newer mobile VR devices released after this date might not be included or have inaccurate parameters, potentially leading to incorrect rendering with `webvr-polyfill`.","severity":"gotcha","affected_versions":"<=1.0.18"},{"fix":"Plan to transition any existing WebVR content to WebXR. This package provides data for a legacy polyfill and should not be relied upon for new development or long-term maintenance.","message":"This package primarily serves as a data source for the `webvr-polyfill`, which itself is considered deprecated. It is unlikely to receive further updates or new device entries.","severity":"deprecated","affected_versions":">=1.0.0"}],"env_vars":null,"last_verified":"2026-04-22T00:00:00.000Z","next_check":"2026-07-21T00:00:00.000Z","problems":[{"fix":"Import the specific JSON file directly: `import dpdb from 'webvr-polyfill-dpdb/dpdb.json';` or `const dpdb = require('webvr-polyfill-dpdb/dpdb.json');`. Ensure your build tool is configured to handle JSON imports.","cause":"Attempting to import the package as a JavaScript module that exports symbols, or importing it in a Node.js environment without a bundler correctly resolving the JSON file.","error":"Cannot find module 'webvr-polyfill-dpdb'"},{"fix":"Verify the import path is correct and that the JSON data is parsed. Ensure you are accessing `dpdb.devices` as an array, as indicated in the package's structure. Confirm the JSON itself is valid.","cause":"The JSON file might not have been loaded correctly, or the structure of the data accessed is incorrect.","error":"dpdb.devices is undefined (or similar error when accessing data)"}],"ecosystem":"npm","meta_description":null}