alexbruf/elm-clerk/2.0.0

Clerk.PublicUserData

The public snapshot of a user that Clerk attaches to a session and to an organization membership.

It is deliberately smaller than Clerk.User: it is the data Clerk is happy to show to other members of an organization.

type alias PublicUserData =
{ firstName : Maybe String
, lastName : Maybe String
, imageUrl : String
, hasImage : Bool
, identifier : String
, userId : Maybe String
, username : Maybe String
, banned : Bool
, deprovisioned : Bool
}

The public fields of a user.

identifier is whatever the user signs in with (an email address, a phone number or a username).

decoder : Decoder PublicUserData

Decode a PublicUserData from the JSON the shim sends.

{ "firstName": "Ada"
, "lastName": "Lovelace"
, "imageUrl": "https://img.clerk.com/ada"
, "hasImage": true
, "identifier": "[email protected]"
, "userId": "user_1"
, "username": "ada"
, "banned": false
, "deprovisioned": false
}

banned and deprovisioned are optional in ClerkJS; the shim sends false when they are absent.