link
method accepts two parameters: the primary profile’s user ID and the secondary profile’s (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 (in this case, 1234567890
).
unlink
method takes three parameters: the secondary profile’s user ID, the secondary profile’s provider (the connection’s ), and the primary profile’s user ID.
The parameters read, essentially: “Unlink this secondary user (with this provider) from this primary user”.
userMetadata
object and then call the patch
method, passing it the user ID and the userMetadata
object. The values in this object will overwrite existing values with the same key, or add new ones for those that don’t yet exist in the user metadata.