> For the complete documentation index, see [llms.txt](https://shedaniel.gitbook.io/cloth-config/llms.txt). Markdown versions of documentation pages are available by appending `.md` to page URLs; this page is available as [Markdown](https://shedaniel.gitbook.io/cloth-config/auto-config/registering-the-config.md).

# Registering the Config

Serialization works with any types supported the following libraries:

* [Jankson (Json5)](https://github.com/falkreon/Jankson)
* [GSON (Json)](https://github.com/google/gson)
* [TOML4J (Toml)](https://github.com/mwanji/toml4j)

If that's not sufficient, you can customize those serialization handlers the same way you would if you used them directly.

{% hint style="info" %}
Register the config before you use it, ideally in your mod's init function.&#x20;
{% endhint %}

There are three built-in serializers for you to choose from, or you can provide your own.

```java
// Only choose one of these!
AutoConfig.register(ModConfig.class, Toml4jConfigSerializer::new);
AutoConfig.register(ModConfig.class, GsonConfigSerializer::new);
AutoConfig.register(ModConfig.class, JanksonConfigSerializer::new);
```

{% hint style="warning" %}
Please read [Partitioning the Config](/cloth-config/auto-config/partitioning-the-config.md) if you want the split the config into multiple files.
{% endhint %}
