# `MqttX.Payload.JSON`
[🔗](https://github.com/cignosystems/mqttx/blob/v0.9.0/lib/mqttx/payload/json.ex#L2)

JSON payload codec using the built-in Erlang/BEAM JSON encoder.

Uses the native JSON module available in OTP 27+ / Elixir 1.18+.

## Usage

    {:ok, json} = MqttX.Payload.JSON.encode(%{temp: 25.5})
    {:ok, data} = MqttX.Payload.JSON.decode(json)

> Note: This module is only available on OTP 27+ where the native JSON module exists.

---

*Consult [api-reference.md](api-reference.md) for complete listing*
