# CyberM.json — 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.

## decode

```lua
CyberM.json.decode(text)
```

`SHARED` — Available without a live game instance.

Parses a JSON string.

Parses JSON into CyberM's bounded Lua value model. Invalid JSON returns `nil, "invalid_json"`; decoded objects and arrays contain only supported scalar/table values.

| Parameter | Type | Required | Default |
|---|---|---|---|
| `text` | `string` | required | — |

Returns: `value, or nil`, `reason`

Registered in `ResourceHost.cpp` (line 6830) as `LuaJsonDecode`.

## encode

```lua
CyberM.json.encode(value)
```

`SHARED` — Available without a live game instance.

Serialises a Lua value to JSON.

Serializes a supported Lua value to JSON using the same bounded representation used by events, exports and WebUI. Functions, userdata, cycles and unsupported table shapes return `nil, reason`.

| Parameter | Type | Required | Default |
|---|---|---|---|
| `value` | `any` | required | — |

Returns: `string, or nil`, `reason`

Registered in `ResourceHost.cpp` (line 6829) as `LuaJsonEncode`.

