SDK
SDK Javascript v7.x
2

mGetUsers #

Gets multiple security users.


mGetUsers(kuids, [options]);

PropertyTypeDescription
ids
string[]
User identifiers
options
object
Query options

options #

PropertyTypeDescription
queuable
boolean
If true, queues the request during downtime, until connected to Kuzzle again
timeout
number

(-1)
Time (in ms) during which a request will still be waited to be resolved. Set it -1 if you want to wait indefinitely
triggerEvents
boolean

(false)
If set to true, will trigger events even if using Embeded SDK. You should always ensure that your events/pipes does not create an infinite loop.
Available since Kuzzle 2.31.0
verb
string
(HTTP only) Forces the verb of the API route

verb #

When instantiated with a HTTP protocol object, the SDK uses the GET API by default for this API route. You can set the verb option to POST to force the SDK to use the POST API instead.

Resolves #

An array of retrieved User objects.

Usage #

try {
  const response = await kuzzle.security.mGetUsers([
    'user1',
    'user2',
    'user3'
  ]);
  console.log(response);
  /*
  [ User {
      _id: 'user1',
      profileIds: ['profile1'],
    User {
      _id: 'user2',
      profileIds: ['profile2'],
    User {
      _id: 'user3',
      profileIds: ['profile3'] ]
   */
} catch (e) {
  console.error(e);
}