Skip to main content

Authenticate Users

In this section, we will show you how to authenticate a 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

Authenticate Users

warning

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

To authenticate a Busy Hour User, you can use the user.signIn function from the @busy-hour/node package. The function take a userId to authenticate as the argument.

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.signIn({
userId: 'your-user-id',
});