User Meta Data

Registeration with MetaData#

To register a user with providing MetaData, you can utilise the below method.

await SDK.register(`USER_IDENTIFIER`, `FORCE_REGISTER`,`registerMetaData` );

Request Params#

StatusDescriptionTypeRequired
USER_IDENTIFIERUnique Id to Register the User. User identifier can only contain lowercase alphanumeric characters, hyphens (-), and underscores (_)Stringtrue
FORCE_REGISTERdefault value true provide true to force the old session logged out when the registered user has reached the maximum number of multiple-sessions or provide false to allow registration till the maximum no of multiple-sessions reachedBooleanfalse
registerMetaDataregisterMetaData is an optional parameter to provide MetaData of user. Maximum size is 3Objectfalse

Request Input for registerMetaData#

ArgumentsDescriptionType
keyName of the KeyString
valueName of the valueString or Boolean or Number

Get User List with MetaData#

Use the below method to retrieve all registered users and it filters the results based on MetaDataFilter. User list can also be retrieved based on search key word, also this method supports pagination. This function will return the total number of pages.

await SDK.getUsersList(`SEARCH_TERM`, `PAGE_NUMBER`, `LIMIT`, `META_DATA_FILTER`);

Request Params#

ArgumentsDescriptionTypeRequired
SEARCH_TERMSearch term to search against the name default value is emptyStringfalse
PAGE_NUMBERPage number to get the particular pages default value is 1Numberfalse
LIMITLimit to set the number of users per page default value is 20Numberfalse
META_DATA_FILTERMetaDataFilter which filters the results by metadata default value is emptyObjectfalse

Sample Format for MetaDataFilter#

{
metaDataKey : "",
metaDataValues: []
}
Request Input for MetaDataKey#
ArgumentsDescriptionType
metaDataKeyName of the KeyString
valueName of the valueString
Request Input for MetaDataValues#
ArgumentsDescriptionType
metaDataValuesName of the KeyString
valueName of the valueArray of String or Boolean or Number

Get MetaData For User#

Using this below method to get the own metaData which is given as input when your registration process.

await SDK.getMetaData();

Example Response#

{
statusCode: 200,
message: "Data Retrieved Successfully",
metaData:
{
type:"test",
phone:"1234567890"
}
}

Update MetaData For User#

Use the below method to update your own metaData.

await SDK.updateMetaData(`Update_MetaData`);

Request Param#

StatusDescriptionTypeRequired
Update_MetaDataUpdate_MetaData is an optional parameter to update MetaData of user. Maximum size is 3Objectfalse

Request Input for Update_MetaData#

ArgumentsDescriptionType
keyName of the KeyString
valueName of the valueString or Boolean or Number

Example Response#

{
statusCode: 200,
message: "User Successfully Updated",
metaData:
{
method:"update"
}
}
note

You didn't pass param (Update_MetaData) to updateMetaData SDK method, it should be considered as a null and updated user MetaData as a null.