# CyberM.webui — client runtime

Runs inside the game process. Reads and presentation are local; anything that changes shared state has to go through the server.

2 functions.

## create

```lua
CyberM.webui.create(options)
```

`SHARED` — Available without a live game instance.

Creates a web surface.

**Creation is asynchronous.** A `show()` issued right after `create` loses the race against the `visible` flag the request carried, and the surface then never paints at all. So a surface meant to stay up is created with `visible = true`, and the page shows or hides its own content.

Valid layers: `hud`, `menu`, `modal`, `system` (needs the `webui.system` permission), `debug`.

| Parameter | Type | Required | Default |
|---|---|---|---|
| `options` | `table` | required | — |

Returns: `surface, or nil`, `reason`

```lua
local overlay = WebUI.create({
    entry = "web/index.html",
    layer = "hud",
    transparent = true,
    visible = true          -- never false for a permanent overlay
})
```

Registered in `ResourceHost.cpp` (line 6581) as `LuaWebUiCreate`.

## default

```lua
CyberM.webui.default()
```

`SHARED` — Available without a live game instance.

The surface declared by `web_ui_page` in the manifest.

Returns the auto-created WebUI page declared by `web_ui_page` in the current manifest. It returns `nil, reason` when the resource has no live default page; the handle is generation-owned and becomes stale after destroy or reload.

Returns: `surface, or nil`

Registered in `ResourceHost.cpp` (line 6582) as `LuaWebUiDefault`.

