> ## Documentation Index
> Fetch the complete documentation index at: https://docs.fivemesh.io/llms.txt
> Use this file to discover all available pages before exploring further.

# Screenshots

> Capture player screenshots and upload them to FiveMesh CDN.

Screenshot helpers use `screenshot-basic` to capture an image, then upload it through the SDK server resource.

Start `screenshot-basic` before `fivemesh-sdk`.

```cfg theme={null}
ensure screenshot-basic
ensure fivemesh-sdk
```

## Capture from the server

Use `takeServerImage` when a server script wants to request a screenshot from a specific player.

```lua theme={null}
local result = exports["fivemesh-sdk"]:takeServerImage(source, {
    reason = "support-ticket"
}, {
    path = "screenshots/support",
    filename = "ticket.webp",
    encoding = "webp",
    quality = 0.82
}, 15000)

print(result.object.publicUrl)
```

The last argument is the timeout in milliseconds.

## Capture from the client

Use client `takeImage` when client code should trigger its own screenshot.

```lua theme={null}
local result = exports["fivemesh-sdk"]:takeImage({
    reason = "profile"
}, {
    path = "screenshots/profile",
    filename = "profile.webp"
})

print(result.object.publicUrl)
```

The client export sends the request back to the SDK server resource. The service key stays server-side.

## Options

| Option     | Description                                      |
| ---------- | ------------------------------------------------ |
| `path`     | Destination folder inside your allowed CDN path. |
| `filename` | Stored filename.                                 |
| `encoding` | Screenshot encoding: `png`, `jpg` or `webp`.     |
| `quality`  | Screenshot quality passed to `screenshot-basic`. |
| `metadata` | Custom metadata stored with the uploaded object. |

## Related pages

* [Installation](/sdk/installation)
* [Server exports](/sdk/server-exports)
* [Troubleshooting](/sdk/troubleshooting)
