Account
With the Pakt SDK, Chainsite builders can establish user account features such as:
Last updated
With the Pakt SDK, Chainsite builders can establish user account features such as:
Last updated
This feature allows you to fetch the authenticated user information. Pass the authorization token to retrieve the information for that user. This feature returns the IUser in its response.
The IUser object contains all the information about the user, see below the description of the fields.
_id
The identifier of the user
string
firstName
The user's first name, inclusive of the middle name(s) if added
string
lastName
The user's last name, inclusive of the middle name(s) if added
string
Verified email address of the user
string
status
Identifer to mark the user account status as blocked or active. status if true, means the user is active, blocked, if false
boolean
profileImage
Object containing information for the profile image of the user
Object
bgImage
Object containing information for the background image of the user
Object
emailVerified
Identifier that returns true if email is verified, false if it isn’t
boolean
type
The type of user, marked as a creator or recipient. This can be changed when updating the profile
string
profile
A response object that contains information about the user.
Record<string, any> | Object
profile.contact.city
Identifier for the city the user updated
string
profile.contact.state
Identifier for the state the user updated
string
profile.contact.phone
Identifier for the phone number the user updated
string
profile.contact.address
Identifier for the address the user updated
string
profile.contact.country
Identifer for the country the user updated
string
profile.bio.title
Simply the designation the user assigns self, for example Software developer
string
profile.bio.description
Detailed Summary explanation of the user's assigned bio
string
profile.talent.availability
Identifier to ascertain the user's access.
busy | available | working
profile.talent.tags
An array of labels that depicts what the user is best renowned for.
string[]
profile.talent.tagsIds
An array of tag objects that depicts what the user is best renowned for
Record<string, any>[]
profile.talent.tagsCategory
The classification of the tags
string
walletGenerated
Identifier to return if a wallet has been generated for this user
boolean
score
This field represents the accumulated points calculated and accrued when the user completes certain actions while using the chainsite, defaults to 0.
number
isPrivate
Identifier depiciting the user as private if true, public if false
boolean
meta
Identifier for information exclusive to the user. This object can be used to store any other additional information that might be exclusive to the user and/or the chainsite
Object
isBookmarked
When a logged in user fetches a list of users with the query , the list is returned with this field to determine that the user is bookmarked by the authenticated user fetching the list.
boolean
bookmarkId
Identifier of the bookmarked user
string
twoFa
Object that identifies the two factor properties of the user
Object
onboarded
Identifier returning the user onboarded status, defaults to false.
boolean
profileCompleteness
Identifier returning, in percentage, just how updated the user profile is completed.
number
achievements
An array list of the user accomplishments, this impacts the
Record<string, any>[]
socket
Object containing the user socket status, the socket status is used for messaging.
Record<string, any>
socket.status
Identifier returning the standing of the user, marked as either OFFLINE, ONLINE, AWAY
OFFLINE, ONLINE, AWAY
referralCode
Identifier returning the code associated with the user. This code can be used to refer others to the chainsite, to register
string
userName
Identifier returning the userName associated with the user
string
extra
Object containing about the user activities carried out in the chainsite
Record<string, any>
Here is an example showcasing how to get the logged-in user information.
A user can update all and any part of their account information, barring the , userName, and score. However, information in the meta-object can be updated. It is recommended to include the previous fields in the meta-object when updating the meta-object.
The updateUserDto is the model used to update the account information. Note that ALL fields are optional.
updateUserDto
firstName
The user's first name, inclusive of the middle name(s) if added
string
lastName
The user's last name, inclusive of the middle name(s) if added
string
profileImage
The uploaded url of the image
string
bgImage
The uploaded url of the image
string
profile
A response object that contains information about the user.
Record<string, any> | Object
profile.contact.city
Identifier for the city the user updated
string
profile.contact.state
Identifier for the state the user updated
string
profile.contact.phone
Identifier for the phone number the user updated
string
profile.contact.address
Identifier for the address the user updated
string
profile.contact.country
Identifer for the country the user updated
string
profile.bio.title
Simply the designation the user assigns self, for example Software developer
string
profile.bio.description
Detailed Summary explanation of the user's assigned bio
string
profile.talent.availability
Identifier to ascertain the user's access.
busy | available | working
profile.talent.tags
An array of labels that depicts what the user is best renowned for.
string[]
profile.talent.tagsIds
An array of tag objects that depicts what the user is best renowned for
Record<string, any>[]
profile.talent.tagsCategory
The classification of the tags
string
socials
Object containing the entries for links to social media accounts that belongs to the user
Object
socials.github
Identifier for the user's github account
string
socials.twitter
Identifier for the user's twitter link
string
socials.linkedin
Identifier for the user's linkedin account
string
socials.webiste
Identifier for the user's website address
string
meta
Identifier for information exclusive to the user. This object can be used to store any other additional information that might be exclusive to the user and/or the chainsite
Object
Authenticated users can change the password of their account. The would request a change to the password.
oldPassword
The previous password used to authenticate
string
newPassword
New and current password to be used for authentication
string
authToken
The authorization token from the login response, on how to login, see the Login feature in Authentication
string
The example code below shows how to implement the change password functionality:
Do you need to store additional data to the user info? check out