SDK
SDK Javascript v5.x
1

You are currently looking at the documentation of a previous version of Kuzzle. We strongly recommend that you use the latest version. You can also use the version selector in the top menu.

setCredentials #

Sets the user's credentials.

Updating user credentials will have no impact until the [`create`](/sdk/js/5/core-classes/user/create) method is called.
The credentials to send depend on the authentication plugin and the strategy you want to create credentials for.
---

setCredentials(credentials) #

ArgumentsTypeDescription
credentialsobjectAn object containing an attribute for each strategy you want to link the user to.

Return Value #

Returns the User object.

Usage #

user.setCredentials({
  '<strategy name>': {
    some: 'credentials'
  }
});