Skip to main content

Creating a User

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

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

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:

PropertyTypeDescription
projectIdstringThe ID of the project that the user will belong to
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.create({
projectId: 'your-project-id',
avatar: null,
nickname: 'your-user-nickname',
attributes: {
'your-custom-attribute-key': 'your-custom-attribute-value',
},
});