alexbruf/elm-clerk/2.0.0

Clerk.OrganizationMembership

The Clerk organization membership resource, one entry of Clerk.User's organizationMemberships.

{ id : String
, organization : Organization
, permissions : List String
, publicMetadata : Value
, publicUserData : Maybe PublicUserData
, role : String
, roleName : String
, createdAt : Posix
, updatedAt : Posix
}

One membership tying a user to an organization.

role is the role key ("org:admin") and roleName its display name. publicMetadata is passed through untouched as a JSON value, which is always an object.

decoder : Decoder OrganizationMembership

Decode an OrganizationMembership from the JSON the shim sends.

{ "id": "orgmem_1"
, "organization": Organization
, "permissions": [ "org:sys_profile:manage" ]
, "publicMetadata": {}
, "publicUserData": PublicUserData
, "role": "org:admin"
, "roleName": "Admin"
, "createdAt": 1700000000000
, "updatedAt": 1700003600000
}

permissions is [] when ClerkJS has none, and publicUserData accepts null.