> For the complete documentation index, see [llms.txt](https://laot7490.gitbook.io/ltbridge/llms.txt). Markdown versions of documentation pages are available by appending `.md` to page URLs; this page is available as [Markdown](https://laot7490.gitbook.io/ltbridge/scripting/callback/register.md).

# Register

Register a callback that the other side can invoke. On the **client**, the server calls your callback. On the **server**, the client calls your callback.

{% hint style="info" %}
**Side:** Client / Server · **Category:** Callback · **API:** `LT.Callback.Register`
{% endhint %}

## Example

```lua
-- Client: server invokes this
LT.Callback.Register('getScreenData', function()
    return { width = 1920, height = 1080 }
end)

-- Server: client invokes this
LT.Callback.Register('getPlayerInventory', function(source)
    return LT.Inventory.GetPlayerInventory(source)
end)
```

## Parameters

| Name   | Required | Description           |
| ------ | -------- | --------------------- |
| `name` | Yes      | Callback name         |
| `cb`   | Yes      | fun(...: any): ...any |
