> ## 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.

# SD cards

> Unlock apps with cards that live inside the tablet instead of in a player's pockets.

An app can be locked behind an item. Normally that means carrying a key item for every app you own, so ten crime apps cost ten inventory slots. SD cards solve that: the unlock is still a real item, but it sits **inside** the tablet.

## How it works

There are two tablets.

<CardGroup cols={2}>
  <Card title="Stock tablet" icon="tablet-screen-button">
    `awoken_tablet`. Opens the tablet and runs every app that is not locked behind a card.
  </Card>

  <Card title="Modded tablet" icon="sd-card">
    `awoken_tablet_sd`. The same tablet with a card reader fitted. **Use** opens it as normal. **Right-click** it and pick **SD Cards** to open its slots.
  </Card>
</CardGroup>

A player drags a card into a slot and the app that asks for that card appears on their home screen. Take the card out and the app goes away.

The card stays a real item the whole time it is installed:

* It can be robbed off a body or seized on arrest, tablet and all.
* It can be sold, traded or planted.
* Installed cards weigh nothing extra, so unlocking an app never costs carry weight.
* The number of slots is a hard cap on how many locked apps one player can run at once.

Only cards that an installed app has asked for can go in. Everything else is rejected, so the tablet never becomes a spare bag.

<Note>
  Card apps belong to the tablet the cards are in, not to the player. Someone carrying a stock tablet and a modded one sees the card apps only when they open the modded one.
</Note>

## Setup

<Steps>
  <Step title="Add the modded tablet item">
    Paste the `awoken_tablet_sd` entry from `install/ox_inventory/items.lua` into your `ox_inventory/data/items.lua`, alongside the stock tablet.

    Keep its `buttons` block. That is what puts **SD Cards** on the right-click menu, and without it there is no way to open the slots.
  </Step>

  <Step title="Copy the image">
    Copy `install/ox_inventory/images/awoken_tablet_sd.png` into `ox_inventory/web/images/`.
  </Step>

  <Step title="Add one item per card">
    Each app that uses a card tells you the item name it expects. Add each one as an ordinary item, using the `sd_example` entry in the same file as a template, and supply your own image.

    ```lua ox_inventory/data/items.lua theme={"dark"}
    ['sd_example'] = {
        label       = 'SD Card: Example',
        weight      = 5,
        stack       = false,
        close       = false,
        description = 'A microSD card. Fits an expansion slot.',
    },
    ```

    You do not list cards anywhere in the tablet's config. An app registering is what makes its card insertable.
  </Step>
</Steps>

<Warning>
  Do **not** add `awoken_tablet_sd` to `ox_inventory/data/containers.lua`. ox\_inventory takes over **Use** on container items, which would stop the tablet ever opening.
</Warning>

The **SD Cards** button has an `icon` field. It shows on Awoken Inventory. Stock ox\_inventory ignores it and the button simply appears without an icon.

## Configuration

```lua config/config.lua theme={"dark"}
Config.SdCards = {
    enabled    = true,
    moddedItem = 'awoken_tablet_sd',
    slots      = 4,
    maxWeight  = 500,

    install = {
        enabled      = true,
        coords       = vec3(1272.4567, -1710.8097, 54.5658),
        radius       = 1.0,
        forceMarker  = false,
        drawDistance = 12.0,
        blip = {
            enabled    = false,
            label      = 'Tablet Modding',
            sprite     = 606,
            colour     = 5,
            scale      = 0.7,
            shortRange = true,
        },
        hiddenFrom = { 'police', 'sheriff', 'bcso', 'sast', 'doj' },
        price      = 500,
        account    = 'cash',
        duration   = 8000,
    },
}
```

| Setting | What it does |
| - | - |
| `slots` | How many cards fit in one tablet. The number to lower when players have too many locked apps at once. |
| `maxWeight` | A weight limit in grams on what can go in the slots. |
| `install.coords` | Where a player gets a reader fitted to their stock tablet. |
| `install.forceMarker` | Use the marker and `[E]` prompt even with ox\_target running. |
| `install.blip` | A map blip for the install point. Off by default. |
| `install.hiddenFrom` | Jobs that cannot see or use the install point. |
| `install.price`, `install.account` | What fitting a reader costs, from `'cash'` or `'bank'`. |
| `install.duration` | Fitting time in milliseconds. Cancelling part way charges nothing. |

### The install point

Players pay to have a reader fitted at `install.coords`. It uses ox\_target when you have it running, and a marker with an `[E]` prompt when you do not.

Police cannot see or use it by default. Hidden means no blip, no target option and no prompt, and the server refuses the install for those jobs too. Put your server's own job names in `hiddenFrom`, or empty the list to let everyone find it.

### Handing out readers yourself

To make the upgrade a heist reward or a black market purchase instead, turn the built-in point off and call the export from your own script:

```lua theme={"dark"}
Config.SdCards.install.enabled = false
```

```lua theme={"dark"}
local ok, reason = exports.awoken_tablet:InstallSdReader(source)
```

See [Exports](/resources/awoken-tablet/exports#sd-cards) for what it returns.

## Turning SD cards off

```lua config/config.lua theme={"dark"}
Config.SdCards.enabled = false
```

Every app locked behind a card falls back to checking the player's pockets for that item instead. Nothing breaks: the cards become ordinary carried key items, and the modded tablet and install point go away. Pick this if you want plain item gating and nothing more.


This documentation is built and hosted on [Mintlify](https://mintlify.com), a developer documentation platform.