# The Util Directory

Some Util directories, such as Address, Cart, Currency, Menu, Price, Product, facilitate working with certain kinds of data. Others define commonly-needed functionality:

| `util` directory    | Purpose                                                                                                                                                               |
| ------------------- | --------------------------------------------------------------------------------------------------------------------------------------------------------------------- |
| Auth                | Responsible for user authentication                                                                                                                                   |
| BrowserDatabase     | Convenience methods for accessing the browser's local storage with a simpler API                                                                                      |
| CSS                 | CSS manipulation. E.g. an utility for setting a CSS variable. This is useful if you want to be able to dynamically edit theme colors from the admin panel.            |
| Extensions          | Implements a part of the plugin mechanism                                                                                                                             |
| FormPortalCollector | Works with form data                                                                                                                                                  |
| History             | Exports a history object using the [`history`](https://www.npmjs.com/package/history) library.                                                                        |
| Media               | Utility for working with media URLs                                                                                                                                   |
| Mobile              | Function that helps determine the browser device, and wether it is a mobile device.                                                                                   |
| Polyfill            | Defines [polyfills](https://en.wikipedia.org/wiki/Polyfill_\(programming\)). Currently includes the [smoothscroll polyfill](https://iamdustan.github.io/smoothscroll) |
| Promise             | Implements a cancelable promise                                                                                                                                       |
| Query               | Defines tools to work with GraphQL queries                                                                                                                            |
| Request             | Defines tools to work with Requests                                                                                                                                   |
| Url                 | Tools to work with URLs and parse them.                                                                                                                               |

Finally, there is the `Braintree` directory, which can handle interaction with the Braintree payment method.

{% hint style="success" %}
When [overriding the theme](https://docs.scandipwa.com/developing-with-scandi/override-mechanism) or creating plugins, you are allowed to [override Util files](https://docs.scandipwa.com/developing-with-scandi/override-mechanism/extending-javascript) to add functionality, or to create your own Util files.
{% endhint %}
