### Run Development Server with Yarn Source: https://github.com/tastypackets/albion-data-client/blob/main/packages/example-app/README.md Starts the React development server. Opens the application at http://localhost:3000 and enables hot reloading for instant feedback on code changes. Displays lint errors in the console. ```shell yarn start ``` -------------------------------- ### Run Tests with Yarn Source: https://github.com/tastypackets/albion-data-client/blob/main/packages/example-app/README.md Launches the test runner in interactive watch mode. Provides information on running tests and allows for continuous testing as code is modified. ```shell yarn test ``` -------------------------------- ### Build for Production with Yarn Source: https://github.com/tastypackets/albion-data-client/blob/main/packages/example-app/README.md Bundles the React application for production, optimizing it for performance. The output is minified and includes content hashes for efficient caching. The compiled assets are placed in the `build` folder. ```shell yarn build ``` -------------------------------- ### Install Albion Data Client Source: https://github.com/tastypackets/albion-data-client/blob/main/packages/client/README.md Installs the Albion Data Client package into your project using the Yarn package manager. ```bash yarn add @albion-data/client ``` -------------------------------- ### Eject Project Configuration with Yarn Source: https://github.com/tastypackets/albion-data-client/blob/main/packages/example-app/README.md A one-way operation that removes the single build dependency from the project. It copies all configuration files (webpack, Babel, ESLint) into the project, granting full control but requiring manual management of dependencies and build tools. ```shell yarn eject ``` -------------------------------- ### Basic Chart Data Lookup Example Source: https://github.com/tastypackets/albion-data-client/blob/main/packages/client/README.md Demonstrates a basic usage of the getChartData method to fetch chart data for a specific item (T5_BAG). It logs the retrieved data to the console or catches and logs any errors. ```javascript import { getChartData } from "@albion-data/client"; getChartData({ itemList: "T5_BAG", }) .then((data) => console.log(data)) .catch((err) => console.error(err)); ``` -------------------------------- ### Albion Data Client: Icon URL Generation Source: https://github.com/tastypackets/albion-data-client/blob/main/packages/client/README.md Generates URLs for item and spell icons using the Albion Render API. getItemIconUrl requires an item identifier and optionally accepts quality and size. getSpellIconUrl requires a spell identifier. getDestinyBoardIconUrl requires a destiny board identifier. ```APIDOC getItemIconUrl({ identifier: "T4_OFF_SHIELD", // String identifier of item, like T4_OFF_SHIELD quality: 2, // Number representing the quality of the item (see QUALITIES_ENUM) size: 50, // Sets width and height in px }); // Return: https://render.albiononline.com/v1/item/T4_OFF_SHIELD.png getSpellIconUrl({ identifier: "HASTE", }); getDestinyBoardIconUrl({ identifier: "ADVENTURER_ADEPT", }); ``` -------------------------------- ### Albion Data Client: Useful Data Types Source: https://github.com/tastypackets/albion-data-client/blob/main/packages/client/README.md Exports helpful data types and enums from the @albion-data/types package, including quality mappings, enchantment mappings, city and market lists, and a comprehensive item ID type. ```javascript // QUALITIES_ENUM - Maps all enum quality numbers to string values // QUALITIES_ENUM[1]; // Normal // QUALITIES_ENUM[2]; // Good // QUALITIES_ENUM.Outstanding; // 3 // ENCHANTMENTS_ENUM - Maps enchantments to numbers, useful for parsing the API response // ENCHANTMENTS_ENUM[0]; // Normal // ENCHANTMENTS_ENUM.Exceptional; // 3 // cityList - An array of all cities in the game // marketList - An array of all markets in the game (cities + Black Market right now) // TItemID - ALL item IDs in the game mapped to a TypeScript type. // Example: // import { TItemID } from "@albion-data/client" // const item: TItemID = "T5_BAG"; ``` -------------------------------- ### Albion Data Client: Price Data Methods Source: https://github.com/tastypackets/albion-data-client/blob/main/packages/client/README.md Fetches item price data from the Albion Data Project API. The getPriceData method returns processed data, while getPriceRaw returns the raw Axios promise. The itemList parameter is required. Optional parameters include locations and qualities. ```APIDOC getPriceRaw - Axios Promise getPriceData - Promise getPriceData({ itemList: ["T5_BAG", "T6_BAG"], // Array of strings or string - required locations: ["Fort Sterling", "Thetford"], // Array of string or string qualities: 2, // Array of numbers or number }); ``` -------------------------------- ### Albion Data Client: Item Locale Information Source: https://github.com/tastypackets/albion-data-client/blob/main/packages/client/README.md Retrieves the localized name and description for an item using its identifier and an optional locale. The default locale is 'en-US'. ```APIDOC getItemLocale({ identifier: "T4_OFF_SHIELD", // String identifier of item, like T4_OFF_SHIELD locale: "en-US", // Optional, defaults to en-US }); // Example response // { // "id":"T4_OFF_SHIELD", // "name":"Adept's Shield", // "description":"Equipment Item" // } ``` -------------------------------- ### Albion Data Client: Gold Data Methods Source: https://github.com/tastypackets/albion-data-client/blob/main/packages/client/README.md Fetches gold price data from the Albion Data Project API. The getGoldData method returns processed data, while getGoldRaw returns the raw Axios promise. No fields are strictly required, but specifying a count to limit results is recommended. Parameters include startDate, endDate, and count. ```APIDOC getGoldRaw - Axios Promise getGoldData - Promise // No Required fields, but count to limit total results is suggested getGoldData({ startDate: new Date(), // Date or date string endDate: new Date(), // Date or date string count: 10, // number }); ``` -------------------------------- ### Albion Data Client: Chart Data Methods Source: https://github.com/tastypackets/albion-data-client/blob/main/packages/client/README.md Fetches chart data from the Albion Data Project API. The getChartData method returns processed data with timezone adjustments, while getChartRaw returns the raw Axios promise. Parameters include itemList, startDate, endDate, locations, qualities, and timeScale. ```APIDOC getChartRaw - Axios Promise getChartData - Promise getChartData({ itemList: "T5_BAG", // Array of strings or string - required startDate: new Date(), // Date or date string endDate: new Date(), // Date or date string locations: "Fort Sterling", // Array of string or string qualities: [1,2], // Array of numbers or number timeScale: 1 // number 1 - 6 }) ``` === COMPLETE CONTENT === This response contains all available snippets from this library. No additional content exists. Do not make further requests.