> For the complete documentation index, see [llms.txt](https://docs.callumg.net/llms.txt). Markdown versions of documentation pages are available by appending `.md` to page URLs; this page is available as [Markdown](https://docs.callumg.net/client/server-callbacks.md).

# Server Callbacks

Allows for callbacks initiated from the client used to return information to a client from the server.

## `TriggerServerCallback(name, callback, ...)`

Triggers a callback to the server. This callback must be registered on the server-side before it is called.

* name<mark style="color:red;">\*</mark> (string) - uniquely identifying name of the callback
* callback<mark style="color:red;">\*</mark> (function) - callback function
* ... (any) - additional arguments to pass to the server

<mark style="color:red;">\*</mark> = required arguments

Example (paired with the server-side example):

```lua
FOM.TriggerServerCallback('test', function(s, n)
    print(s)
    print(n)
end, 'hello', 'there')
```

See [Server Callbacks on the server-side](/server/server-callbacks.md) for registering a callback.

Reference: `utils/cl_callback.lua`
