> ## 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.

# FiveM SDK

> Use the FiveMesh SDK resource to call FiveMesh CDN from FiveM server scripts.

The FiveMesh SDK is a FiveM resource that connects your server scripts to the FiveMesh API.

Use it when a resource needs to upload, list, delete or purge FiveMesh CDN objects without hand-writing HTTP requests. The SDK keeps your service key on the server side. Client exports call back to the server resource before anything is sent to FiveMesh.

<Warning>
  Do not place a FiveMesh service key in client-side Lua, NUI code or browser bundles. Configure the key as a server ConVar and let the SDK call the API from the server resource.
</Warning>

## What the SDK covers

| Area               | Exports                                        |
| ------------------ | ---------------------------------------------- |
| Object reads       | `listObjects`                                  |
| Object uploads     | `uploadFile`, `uploadImage`, `bulkUpload`      |
| Object deletion    | `deleteObject`, `bulkDelete`                   |
| CDN cache purge    | `purgeObjects`                                 |
| Scoped upload URLs | `createPresignedUrl`, `uploadWithPresignedUrl` |
| Screenshots        | `takeServerImage`, client `takeImage`          |

FiveMesh Cache helpers are not part of the first SDK release.

## Start here

<Columns cols={2}>
  <Card title="Install the SDK" icon="download" href="/sdk/installation">
    Add the resource, configure `FIVEMESH_API_KEY` and confirm the SDK starts.
  </Card>

  <Card title="Call server exports" icon="server" href="/sdk/server-exports">
    Upload, list, delete and purge CDN objects from server-side Lua or JavaScript.
  </Card>

  <Card title="Capture screenshots" icon="camera" href="/sdk/screenshots">
    Use `screenshot-basic` with `takeServerImage` or client `takeImage`.
  </Card>

  <Card title="Create upload URLs" icon="link" href="/sdk/presigned-uploads">
    Give another script a short-lived upload target without exposing your service key.
  </Card>
</Columns>

## Permissions

Use these permissions when creating the service key:

| Permission   | Required for                                                                                           |
| ------------ | ------------------------------------------------------------------------------------------------------ |
| `cdn:read`   | `listObjects`                                                                                          |
| `cdn:write`  | `uploadFile`, `uploadImage`, `bulkUpload`, `createPresignedUrl`, `takeServerImage`, client `takeImage` |
| `cdn:delete` | `deleteObject`, `bulkDelete`                                                                           |
| `cdn:purge`  | `purgeObjects`                                                                                         |

<Tip>
  Scope the service key to the path your resource owns, such as `/phone`, `/screenshots` or `/inventory`. This limits what the script can access if the key is copied by mistake.
</Tip>

## Related pages

* [API keys](/account/api-keys)
* [FiveMesh CDN API](/api-reference/cdn)
* [LB-Scripts integration](/integrations/lb-scripts)
