Employee Onboarding

Overview

The Employee Onboarding workflow provides a complete experience for onboarding an employee to a company. It is used to collect all required information for an employee to be added to payroll.

Implementation

import { EmployeeOnboardingFlow } from '@gusto/embedded-react-sdk';

function MyApp() {
  return(
    <EmployeeOnboardingFlow 
      companyId="a007e1ab-3595-43c2-ab4b-af7a5af2e365" 
      onEvent={() => {}}
    />
  );
}

Props

NameTypeDescription
employeeIdstringThe associated employee identifier.
companyId RequiredstringThe associated company identifier.
onEvent RequiredSee events table for each subcomponent to see available events.

Using Employee Subcomponents

Employee onboarding components can be used to compose your own workflow, or can be rendered in isolation. For guidance on creating a custom workflow, see docs on composition.

Available Subcomponents

  • Employee.EmployeeList
  • Employee.Profile
  • Employee.Compensation
  • Employee.Taxes
  • Employee.PaymentMethod
  • Employee Deductions
  • Employee.OnboardingSummary

Employee.List

Displays a list of employees containing their full name, and their current onboarding status. An onboarding status. This list also contains actions that allow for the editing or removal of an employee.

import { Employee } from '@gusto/embedded-react-sdk';

function MyApp() {
  return (
    <Employee.EmployeeList 
      companyId="a007e1ab-3595-43c2-ab4b-af7a5af2e365" 
      onEvent={() => {}} 
    />
  );
}

Props

NameTypeDescription
companyId RequiredstringThe associated company identifier.
onEvent RequiredSee events table below for available events.

Events

Event typeDescriptionData
EMPLOYEE_CREATEFired when user clicks "Add employee" buttonUndefined
EMPLOYEE_UPDATEFired when user selects "Edit" from employee actions menu{ employeeId: string }
EMPLOYEE_DELETEDFired after selecting delete from the employee actions menu and the deleting an employee operation completesResponse data from Delete an onboarding employee endpoint

Employee.Profile

Used to collect basic information about the employee:

  • First and last name
  • Work address and start date
  • Email address
  • Social security number
  • Date of birth
  • And home address

This component also provides the option to invite the employee to enter some of their details themself. If selected, they can be sent an invitation to complete the form.

import { Employee } from '@gusto/embedded-react-sdk';

function MyComponent() {
  return (
    <Employee.Profile
      defaultValues={{ employee: { email: '[email protected]' } }}
      companyId="a007e1ab-3595-43c2-ab4b-af7a5af2e365"
      employeeId="4b3f930f-82cd-48a8-b797-798686e12e5e"
      onEvent={() => {}}
      isAdmin // Set to true for admin onboarding
    />
  );
}

Props

NameTypeDefaultDescription
companyId RequiredstringThe associated company identifier.
employeeIdstringfalseThe associated employee identifier.
onEvent RequiredSee events table for available events.
isAdminbooleanfalseIf the onboarding is being performed by an admin. When false it is configured to be self onboarding.
defaultValues{
employee?: {
first_name?: string
middle_initial?: string
last_name?: string
email?: string
date_of_birth?: string
}
homeAddress?: {
street_1?: string
street_2?: string
city?: string
state?: string
zip?: string
}
}
undefinedDefault values for the employee profile form inputs. If employee data is available via the API, defaultValues will be overwritten.

Events

Event typeDescriptionData
EMPLOYEE_CREATEFired after form is submitted when creating a new employeeResponse from the Create an employee endpoint
EMPLOYEE_UPDATEDFired after form is submitted when editing/updating an existing employeeResponse from the Update an employee endpoint
EMPLOYEE_HOME_ADDRESS_CREATEDFired after form is submitted when creating a new employeeResponse from the Create an employee's home address endpoint
EMPLOYEE_HOME_ADDRESS_UPDATEDFired after form is submitted when editing/updating an existing employeeResponse from the Update an employee's home address endpoint
EMPLOYEE_WORK_ADDRESS_CREATEDFired after form is submitted when creating a new employeeResponse from the Create a work address endpoint
EMPLOYEE_WORK_ADDRESS_UPDATEDFired after form is submitted when editing/updating an existing employeResponse from the Update a work address endpoint
EMPLOYEE_PROFILE_DONEFired after form submission and all api calls have finished and we are ready to advance to the next stepCalled with an object aggregated with the responses above. This either includes all of the responses for creating new entities (if it is creating a new employee) or all the responses for updating entities (if it is updating an existing employee)
CANCELFired when user clicks cancel buttonNone

Employee.Compensation

Collects details related to the role of the employee and their compensation:

  • Job title
  • Employee type (eg., Hourly, Salary)
  • Compensation amount
  • Pay period (e.g., hourly, daily, weekly, monthly, annually)

For hourly employees, the compensation component allows for the configuration of multiple roles.

import { Employee } from '@gusto/embedded-react-sdk';

function MyComponent() {
  return(
  	<Employee.Compensation
        employeeId="4b3f930f-82cd-48a8-b797-798686e12e5e"
        startDate="01-01-2025"
        onEvent={() => {}}
      />
  );
}

Props

NameTypeDescription
employeeId RequiredstringThe associated employee identifier.
startDate RequiredstringThe date the employee will start work.
onEvent RequiredSee events table for available events.
defaultValues{ title?: string | null rate?: string payment_unit?: string }Default values for the employee profile form inputs. If employee data is available via the API, defaultValues will be overwritten.

Events

Event typeDescriptionData
EMPLOYEE_JOB_CREATEDFired after compensation form is submitted if compensation is newResponse from the Create a job endpoint
EMPLOYEE_JOB_UPDATEDFired after compensation form is submitted if editing compensation and compensation is updatedResponse from the Update a job endpoint
EMPLOYEE_JOB_DELETEDFired after successfully deleting a jobResponse from the Delete a job endpoint
EMPLOYEE_COMPENSATION_UPDATEDFired after updating compensation detailsResponse from the Update a compensation endpoint
EMPLOYEE_COMPENSATION_DONEFired when compensation setup is complete and we are ready to advance to the next stepNone

Employee.Taxes

Provides required form inputs for employee state and federal tax configuration.

import { Employee } from '@gusto/embedded-react-sdk';

function MyComponent() {
  return(
    <Employee.Taxes
      employeeId="4b3f930f-82cd-48a8-b797-798686e12e5e"
      onEvent={() => {}}
    />
  );
}

Props

NameTypeDefaultDescription
employeeId RequiredstringThe associated employee identifier.
onEvent RequiredSee events table for available events.
isAdminbooleanfalseIf the onboarding is being performed by an admin. When false it is configured to be self onboarding.

Events

Event typeDescriptionDataDescription
EMPLOYEE_FEDERAL_TAXES_UPDATEDFired when the employee taxes form is submitted and federal taxes are successfully updatedResponse from the Update federal taxes endpointThe associated employee identifier.
EMPLOYEE_STATE_TAXES_UPDATEDFired when the employee taxes form is submitted and state taxes are successfully updatedResponse from the Update state taxes endpointSee events table for available events.
EMPLOYEE_TAXES_DONEFired when the employee taxes form is successfully submitted, above API requests are completed, and we are ready to advance to the next stepNoneIf the onboarding is being performed by an admin. When false it is configured to be self onboarding.

Employee.PaymentMethod

Used for configuring employee bank account(s). Bank accounts created with this component will be used to pay the employee when payroll is run. Payments can be split across multiple accounts.

import { Employee } from '@gusto/embedded-react-sdk';

function MyComponent() {
  return(
  	<Employee.PaymentMethod
        employeeId="4b3f930f-82cd-48a8-b797-798686e12e5e"
        onEvent={() => {}}
      />
  );
}

Props

NameTypeDescription
employeeId RequiredstringThe associated employee identifier.
onEvent RequiredSee events table for available events.

Events

Event typeDescriptionData
EMPLOYEE_BANK_ACCOUNT_CREATEDFired after add bank account form is submitted and new account is createdResponse from the Create a bank account endpoint
EMPLOYEE_BANK_ACCOUNT_DELETEDFired after deleting a bank accountResponse from the Delete a bank account endpoint
EMPLOYEE_PAYMENT_METHOD_UPDATEDFired when the employee updates the payment method by selecting the continue CTA or if they opt to split paychecks and save the split paycheck formResponse from the Update payment method endpoint
EMPLOYEE_PAYMENT_METHOD_DONEFired when the continue CTA is selected on the payment details step, all API calls are finished, and we are ready to advance to the next stepNone

Employee.Deductions

Used for configuring additional withholdings from employee pay. Deductions can be set by percentage or fixed amount, and can be either recurring or one-time.

import { Employee } from '@gusto/embedded-react-sdk';

function MyComponent() {
  return(
  	<Employee.Deductions
        employeeId="4b3f930f-82cd-48a8-b797-798686e12e5e"
        onEvent={() => {}}
      />
  );
}

Props

NameTypeDescription
employeeId RequiredstringThe associated employee identifier.
onEvent RequiredSee events table for available events.

Events

Event typeDescriptionData
EMPLOYEE_DEDUCTION_ADDFired when user initially navigates to the deduction formNone
EMPLOYEE_DEDUCTION_CREATEDFired after a new deduction is createdResponse from the Create a garnishment endpoint
EMPLOYEE_DEDUCTION_UPDATEDFired after a deduction is editedResponse from the Update a garnishment endpoint
EMPLOYEE_DEDUCTION_DELETEDFired after deleting a deductionResponse from the Update a garnishment endpoint with active:false
EMPLOYEE_DEDUCTION_DONEFired when deductions setup is complete and user is ready to navigate to the next stepNone

Employee.OnboardingSummary

Displays the current state of employee onboarding.

import { Employee } from '@gusto/embedded-react-sdk';

function MyComponent() {
  return(
  	<Employee.OnboardingSummary
        employeeId="4b3f930f-82cd-48a8-b797-798686e12e5e"
        onEvent={() => {}}
        isAdmin // Set to true for admin onboarding
      />
  );
}

Props

NameTypeDefaultDescription
employeeId RequiredstringThe associated employee identifier.
onEvent RequiredSee events table for available events.
isAdminbooleanfalseIf the onboarding is being performed by an admin. When false it is configured to be self onboarding.

Events

Event typeDescriptionData
EMPLOYEES_LISTFired when user clicks to return to employee listNone
EMPLOYEE_CREATEFired when user clicks to add another employeeNone