JwtLite

Lightweight JWT decoder for Elixir. Decode and inspect JWTs without signature verification. Zero dependencies.

Installation

def deps do
[{:jwt_lite, "~> 0.1"}]
end

Usage

token = "eyJhbGciOiJIUzI1NiIsInR5cCI6IkpXVCJ9.eyJzdWIiOiIxMjM0IiwibmFtZSI6IkFsaWNlIiwiZXhwIjo5OTk5OTk5OTk5fQ.sig"
{:ok, %{header: header, payload: payload}} = JwtLite.decode(token)
# => %{"alg" => "HS256", "typ" => "JWT"}
JwtLite.expired?(token) # => false
JwtLite.ttl(token) # => seconds until expiry

API

Tip Jar

If this saves you time, tips are welcome:
ETH / Polygon / Base: 0x7463903430D5294DcfBa09Abb9B8B30A42BdFe36

License

MIT