e-bon
e-bon.ro
TypeScript SDK

client.users

Reference for the UsersResource — read and update the authenticated user's profile and change password, mirroring /api/v1/users/me.

client.users

client.users wraps /api/v1/users/me/* — the authenticated user's profile and password change. There are no methods that read or modify other users; user management is part of the Organizations API (members) rather than this resource.

Minimal surface — see the Users API reference for the full endpoint contract, including admin-only paths that the SDK does not yet expose.

HTTP-level failures surface as EBonApiError — see Errors and /en/api/errors.

client.users.get()

Get the authenticated user's profile.

async get(): Promise<UserProfile>

No parameters. Returns { uid, email, displayName, phoneNumber, createdAt, role }.

const me = await client.users.get();

client.users.update(body)

Update the authenticated user's profile.

async update(body: UpdateUserBody): Promise<UserProfile>
NameTypeRequiredNotes
displayNamestringnoNew display name.
phoneNumberstringnoNew phone number (E.164 recommended).

Returns the updated UserProfile.

await client.users.update({ displayName: 'Ana Popescu' });

client.users.changePassword(body)

Change the authenticated user's password.

async changePassword(body: ChangePasswordBody): Promise<undefined>
NameTypeRequiredNotes
currentPasswordstringyesThe current password (re-auth challenge).
newPasswordstringyesThe new password.

Returns undefined on success.

await client.users.changePassword({
  currentPassword: process.env.OLD_PW!,
  newPassword: process.env.NEW_PW!,
});