alexbruf/elm-clerk/1.0.0

NOTE: the latest version is 2.0.0

Clerk.Session

The Clerk session resource, reduced to the fields listed in coverage.json.

The session token is deliberately absent: tokens are only available through Clerk.requestToken, which round-trips to ClerkJS so the token is always fresh.

type alias Session =
{ id : String
, status : String
, lastActiveAt : Posix
, expireAt : Posix
}

The active Clerk session.

status is passed through as ClerkJS reports it (for example "active"), so a new status value never fails to decode.

decoder : Decoder Session

Decode a Session from the JSON the shim sends.

{ "id": "sess_1"
, "status": "active"
, "lastActiveAt": 1700000000000
, "expireAt": 1700003600000
}

Both timestamps arrive as epoch milliseconds.