@ubstream/ubstream-node-client-sdk / Exports / OrganizationsUsersClient
Class: OrganizationsUsersClient
This class provides access to methods to manage user in an organization.
Hierarchy
AbstractClient
↳ OrganizationsUsersClient
Table of contents
Methods
Methods
createUser
▸ createUser(orgId
, userToCreate
): Promise
<IPublicUserData
>
Parameters
Name | Type | Description |
---|---|---|
orgId | string | The uuid of the targeted organization. |
userToCreate | IPublicUserForm | The user to be created. |
Returns
Promise
<IPublicUserData
>
Promise returning the created user.
Summary
Create user in an organization.
Example
const userToCreate: IPublicUserForm = {
email: 'test@test.com',
password: 'test',
username: 'test',
acceptTermsAndConditions: true,
isPasswordTemporary: false,
};
const newUser = await client.organizations.users.createUser("organization_id", userToCreate);
getUserById
▸ getUserById(userId
): Promise
<IPublicUserData
>
Parameters
Name | Type | Description |
---|---|---|
userId | string | The uuid of the targeted user. |
Returns
Promise
<IPublicUserData
>
Promise object representing the fetched user.
Summary
Retrieve user by its id.
Example
const user = await client.organizations.users.getUserById("user_id");