> For the complete documentation index, see [llms.txt](https://ksdaemon.gitbook.io/wampy.js/llms.txt). Markdown versions of documentation pages are available by appending `.md` to page URLs; this page is available as [Markdown](https://ksdaemon.gitbook.io/wampy.js/using-custom-serializer.md).

# Using custom serializer

From v5.0 version there is option to provide custom serializer.

Custom serializer instance must meet a few requirements:

* Have a `encode (data)` method, that returns encoded data
* Have a `decode (data)` method, that returns decoded data
* Have a `protocol` string property, that contains a protocol name. This name is concatenated with "wamp.2." string and is then passed as websocket subprotocol http header.
* Have a `isBinary` boolean property, that indicates, is this a binary protocol or not.

Take a look at JsonSerializer.js or MsgpackSerializer.js as examples.
