Skip to main content

Updating a User

In this section, we will show you how to update a pre-existing Busy Hour User.

Prerequisites

  1. Busy Hour Account (Sign Up if you don't have one yet)
  2. Generate a Master/Project API Key from Dashboard/Settings or from Dashboard/Projects

Updating a User

warning

You can update a Busy Hour User with any Master API Key or a Project API Key that only specificly for the project user you want to update.

To update a Busy Hour App, you can use the user.update function from the @busy-hour/node package. The function take an object with the following properties:

PropertyTypeDescription
userIdstringThe ID of the user
avatarstring (optional)The avatar of the user
nicknamestringThe nickname of the user
attributesobjectAny custom attributes of the user in JSON format

Quick Example

src/main.ts
import { BusyHourNode } from '@busy-hour/node';

// Create an instance of BusyHourNode with your API key (Master/Project)
const nodeSdk = new BusyHourNode({
apiToken: 'your-api-token',
});

nodeSdk.user.update({
userId: 'your-user-id',
payload: {
avatar: null,
nickname: 'your-user-nickname',
attributes: {
'your-custom-attribute-key': 'your-custom-attribute-value',
},
},
});