> ## Documentation Index
> Fetch the complete documentation index at: https://docs.awokenlabs.com/llms.txt
> Use this file to discover all available pages before exploring further.

# Installation

> Install Awoken UI and Awoken Target on your FiveM server.

## Asset download

<Info>
  To find the asset, you must have made the purchase using your own keymaster account. Otherwise, you can use the transfer system to move the asset to a different keymaster account.
</Info>

Once the purchase is made on our official website, you will receive your asset directly in your [cfx portal](https://portal.cfx.re/) in your own panel you can download the asset and install it following the following documentation.

## Requirements

* [ox\_lib](https://github.com/overextended/ox_lib) (latest version)

## Installation

<Steps>
  <Step title="Add the resources">
    Place both the `awoken_ui` and `ox_target` (Awoken version) folders into your server's `resources` directory. You can install just Awoken UI or just Awoken Target if you prefer, but both work best together.
  </Step>

  <Step title="Back up and replace ox_target">
    <Warning>
      If you already have an `ox_target` resource running, **back up any custom changes** you've made to it first, then delete the existing folder completely before installing the Awoken version.
    </Warning>

    The Awoken Target is a drop-in replacement that uses the same path structure (e.g. `resources/[ox]/ox_target`).
  </Step>

  <Step title="Hook into ox_lib">
    Add the following code to the **very end** of `ox_lib/init.lua`:

    ```lua theme={"dark"}
    -- Awoken UI
    local AWOKEN_RESOURCE <const> = 'awoken_ui'
    if GetResourceState(AWOKEN_RESOURCE) ~= 'missing' then
        local success, err = pcall(function()
            local code = LoadResourceFile(AWOKEN_RESOURCE, 'init.lua')
            if code then load(code)() end
        end)

        if not success then
            print(('[Awoken UI] Failed to load init.lua: %s'):format(err))
        end
    end
    ```

    This allows Awoken UI to seamlessly override ox\_lib's UI functions. No changes are needed in any other scripts - any resource that uses `lib.notify()`, `lib.progressBar()`, `lib.showContext()`, etc. will automatically use Awoken UI.
  </Step>

  <Step title="Configure server.cfg">
    Add the following to your `server.cfg`, making sure both resources start **after** `ox_lib`:

    ```cfg theme={"dark"}
    # Awoken primary colour - shared across all awoken resources
    setr awoken:primaryColor "#00E5FF"

    ensure ox_target
    ensure ox_lib
    ensure awoken_ui
    ```

    The `awoken:primaryColor` convar sets your accent colour globally. Any awoken-styled resource will read this value. If not set, it defaults to `#00E5FF`.
  </Step>

  <Step title="Verify">
    Join the server and test:

    * Any script calling `lib.notify()`, `lib.progressBar()`, or other ox\_lib UI functions should render with the Awoken UI theme.
    * Press your target hotkey (default **Left Alt**). The targeting eye icon should appear with the Awoken Design.
  </Step>
</Steps>

<Info>
  Awoken Target provides full backward compatibility with **qtarget / bt-target** exports, so existing scripts using those APIs will continue to work without changes.
</Info>

<Note>
  **Running QBCore with `qb-radialmenu`?** qb-radialmenu uses its own NUI and doesn't hook ox\_lib, so it won't render through Awoken UI by default. See the [QBCore Radial Menu](/resources/awoken-ui/qb-radialmenu) guide for a small bridge that fixes this without removing the resource. QBX servers using `qbx_radialmenu` work out of the box, no bridge needed.
</Note>

## Dependencies

| Resource | Required by              | Type         |
| -------- | ------------------------ | ------------ |
| `ox_lib` | Awoken UI, Awoken Target | **Required** |

## Updating

Re-download the resource(s) from Tebex, replace the folder(s), and restart with
`ensure awoken_ui` / `ensure ox_target`.
