# `MPP.Codec`
[🔗](https://github.com/ZenHive/mpp/blob/v0.10.0/lib/mpp/codec.ex#L1)

Shared base64url→JSON token decoding for the wire-format modules
(`MPP.Credential`, `MPP.Receipt`, `MPP.Methods.Tempo.SessionReceipt`).

Owns exactly the decode→error-tag step; callers keep their own downstream
shape validation (`from_map/1`) and any pre-checks (e.g. a token-size cap).

# `decode_base64_json`

```elixir
@spec decode_base64_json(String.t()) ::
  {:ok, term()} | {:error, :invalid_base64 | :invalid_json}
```

Decode a base64url (no padding) JSON string into its parsed term.

Returns `{:ok, decoded}` where `decoded` is the parsed JSON value, or a tagged
error: `{:error, :invalid_base64}` when the string is not valid base64url, and
`{:error, :invalid_json}` when the decoded bytes are not valid JSON.

---

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