Fetches something from itemDB, handling authentication issues arising from the March 2026 API update.
Este script não deve ser instalado diretamente. É uma biblioteca destinada a ser incluída por outros scripts através da diretiva de metadados // @require https://update.greasyfork.org/scripts/567036/1868582/itemDB%20Fetch%20Lib.js
This is not a script and does nothing on its own. It was created to be @required by userscripts.
This allows an userscript to send a query to itemDB, showing an error message if the user is unauthenticated.
To use it, asynchronously call the function fetchItemDb(url, scriptName, body?).
url: The URL you would use for a fetch (example: https://itemdb.com.br/api/v1/items/negg)
scriptName: Your script's name for UI purposes in case authorization fails
body: The body (data) of your request IF it's a POST request. Otherwise, don't provide it. You should stringify your body before providing it as a parameter.