Updating a User
In this section, we will show you how to update a pre-existing Busy Hour User.
Prerequisites
- Busy Hour Account (Sign Up if you don't have one yet)
- 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:
Property | Type | Description |
---|---|---|
userId | string | The ID of the user |
avatar | string (optional) | The avatar of the user |
nickname | string | The nickname of the user |
attributes | object | Any 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',
},
},
});