Skip to main content

Profile Methods

Methods related to getting and setting user profile data.

Profile

Profile(
  userAddress, // optional
  userName // optional
) → Promise.<Object>

Retrieve profile info for the specified user, including address, username, profile image (if set) and badges (if any)

Returns: Profile info of the specified user

Parameters

NameTypeRequiredDescription
userAddressstring

Address of the user

userNamestring

Username of the user

ProfileMetadata

ProfileMetadata({
  type, // optional
  mode, // optional
  appId, // optional
  userAddress, // optional
  key // optional
}) → Promise.<(Object|String)>

Retrieve user profile metadata for the specified user

Returns: Returns the specified metadata

Parameters

NameTypeRequiredDescription
typestring

Specify app or user metadata.

(default: "app")
modestring

Specify public or private metadata. If private is specified, you may only retrieve metadata for the current user.

(default: "public")
appIdstring

Namespace to use for the metadata, if retrieving app metadata. Uses the app ID specified on client initialization by default.

userAddressstring

User to retrieve metadata for. If not specified, will retrieve metadata for the current user

keystring

The metadata key to retrieve

RemoveProfileMetadata

RemoveProfileMetadata({
  type, // optional
  mode, // optional
  appId, // optional
  key
})

Remove user profile metadata for the current user

Parameters

NameTypeRequiredDescription
typestring

Specify app or user metadata.

(default: "app")
modestring

Specify public or private metadata.

(default: "public")
appIdstring

Namespace to use for the metadata, if retrieving app metadata.. Uses the app ID specified on client initialization by default.

keystring

The metadata key to set

SetProfileMetadata

SetProfileMetadata({
  type, // optional
  mode, // optional
  appId, // optional
  key,
  value
})

Set user profile metadata for the current user

Parameters

NameTypeRequiredDescription
typestring

Specify app or user metadata.

(default: "app")
modestring

Specify public or private metadata.

(default: "public")
appIdstring

Namespace to use for the metadata, if retrieving app metadata. Uses the app ID specified on client initialization by default.

keystring

The metadata key to set

valuestring

The metadata value to set