> For the complete documentation index, see [llms.txt](https://docs.xibosignage.com/llms.txt). Markdown versions of documentation pages are available by appending `.md` to page URLs; this page is available as [Markdown](https://docs.xibosignage.com/developer/widgets/upgrading/upgrading-to-v3.md).

# Upgrading to v3

If you’ve written a custom Module for CMS version 2.x, you will need to make several code changes to make it work and look correct in CMS version 3.

Please note, we’ve addressed the changes from 1.8 to version 2.x in an earlier page: [Upgrading to v2](/developer/widgets/upgrading/upgrading-to-v2.md) — please make sure you have done those changes first.

**Request/Response objects**

In version 3 of the CMS we use PSR request and response objects liberally throughout the application code base. This affects the Module edit and settings methods, which now have the following signature:

{% code title="Module method signatures" %}

```php
/**
 * Edit Widget
 * @param \Slim\Http\ServerRequest $request
 * @param \Slim\Http\Response $response
 * @return \Slim\Http\Response
 * @throws GeneralException
 */
public function edit(Request $request, Response $response): Response;

/**
 * Module Settings
 * @param \Slim\Http\ServerRequest $request
 * @param \Slim\Http\Response $response
 * @throws GeneralException
 * @return \Slim\Http\Response
 */
public function settings(Request $request, Response $response): Response;
```

{% endcode %}

In most cases you will return the `$response` provided without modification, however you are free to adjust it if necessary, for example to add some headers, or change the return code.

**Sanitizer**

Version 3 has a new Sanitizer library, which is loaded and accessed in a different way. First get the request parameters using `$request->getParams()`, then pass those into the Sanitizer and receive back a new Sanitizer object which you can pull sanitized parameters from.

{% code title="Using the Sanitizer" %}

```php
$sanitizedParams = $this->getSanitizer($request->getParams());
$name = $sanitizedParams->getString('name');
```

{% endcode %}


---

# Agent Instructions
This documentation is published with GitBook. GitBook is the documentation platform designed so that both humans and AI agents can read, navigate, and reason over technical content effectively. Learn more at gitbook.com.

## Querying This Documentation
If you need additional information that is not directly available in this page, you can query the documentation by asking a question.

Perform an HTTP GET request on the following URL with the `ask` and `goal` query parameters:

```
GET https://docs.xibosignage.com/developer/widgets/upgrading/upgrading-to-v3.md?ask=<question>&goal=<user_goal>
```

`ask` is the immediate question: it should be specific, self-contained, and written in natural language.
`goal` is what the user is ultimately trying to achieve, the reason they need the answer. Sharing it helps GitBook give you a better, more relevant answer. A goal is most helpful when it describes the outcome the user wants rather than restating the question. For example, with `ask=how do I create an API token`, a goal like `automate deployments from our CI pipeline` lets GitBook tailor the answer to that use case.

The response will contain a direct answer to the question and relevant excerpts and sources from the documentation.

Use this mechanism when the answer is not explicitly present in the current page, you need clarification or additional context, or you want to retrieve related documentation sections.
