The Clerk user resource, with the fields listed in coverage.json.
Fields that ClerkJS exposes but this package does not decode are simply ignored, so a Clerk release that adds a field cannot break decoding.
Decode a User from the JSON the shim sends.
{ "id": "user_1"
, "externalId": null
, "username": "ada"
, "fullName": "Ada Lovelace"
, "firstName": "Ada"
, "lastName": "Lovelace"
, "imageUrl": "https://img.clerk.com/ada"
, "hasImage": true
, "primaryEmailAddressId": "idn_1"
, "primaryEmailAddress": "[email protected]"
, "primaryPhoneNumberId": null
, "primaryPhoneNumber": null
, "primaryWeb3WalletId": null
, "primaryWeb3Wallet": null
, "emailAddresses": [ EmailAddress ]
, "phoneNumbers": []
, "web3Wallets": []
, "externalAccounts": []
, "enterpriseAccounts": []
, "passkeys": []
, "organizationMemberships": []
, "passwordEnabled": true
, "totpEnabled": false
, "backupCodeEnabled": false
, "twoFactorEnabled": false
, "publicMetadata": {}
, "unsafeMetadata": {}
, "lastSignInAt": 1700000000000
, "legalAcceptedAt": null
, "createdAt": 1699990000000
, "updatedAt": 1700000000000
}Every nullable field accepts null; lists may be empty. Timestamps arrive
as epoch milliseconds.
A signed-in Clerk user.
primaryEmailAddress,primaryPhoneNumberandprimaryWeb3Walletare the identifier strings themselves (user.primaryEmailAddress?.emailAddressin ClerkJS), not resource objects; the full resources are in the matching lists, keyed by theprimary...Idfields.publicMetadataandunsafeMetadataare passed through untouched as JSON values, always objects.