Creating a User
In this section, we will show you how to update a pre-existing Busy Hour Project.
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
Creating a User
warning
You can create a Busy Hour User with any Master API Key or a Project API Key that only specificly for the project user you want to create.
To create a Busy Hour User, you can use the user.create
function from the @busy-hour/node
package. The function take an object with the following properties:
Property | Type | Description |
---|---|---|
projectId | string | The ID of the project that the user will belong to |
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.create({
projectId: 'your-project-id',
avatar: null,
nickname: 'your-user-nickname',
attributes: {
'your-custom-attribute-key': 'your-custom-attribute-value',
},
});