UsersAPIClient
instance by passing it the account
and the token for the primary identity. In the case of linking users, this primary identity is the user profile that you want to “keep” the data for, and to which you plan to link other identities.
link
method accepts two parameters: the primary user id and the secondary user token (the token obtained after login with this identity). The user id in question is the unique identifier for this user account. If the id is in the format facebook|1234567890
, the id required is the portion after the delimiting pipe.
unlink
method takes three parameters: the primary user id, the secondary user id, and the secondary provider (of the secondary user).
metadata
object and then call the updateMetadata
method, passing it the user id and the metadata
object. The values in this object overwrite existing values with the same key, or add new values for those that don’t yet exist in the user metadata.