SelfOnboardingFlow
Guided flow for employees to complete their own onboarding.
Remarks
Hands the employee responsibility for submitting their own profile, tax, payment, and document-signing information. Drives a multi-step flow keyed to the employee being self-onboarded; when withEmployeeI9 is enabled, the Document Signer step checks whether the employee has I-9 enabled and, if so, routes them through the employment-eligibility form before presenting the I-9 form alongside other required documents.
Each step is also exported as a standalone block (see the Blocks table) for composing a custom workflow when this orchestration is the wrong fit.
The flow forwards every event emitted by its blocks to onEvent; see the events table on each block for the full set of events and payloads observable from this flow.
Example
import { EmployeeOnboarding, type EventType } from '@gusto/embedded-react-sdk'
function MyApp() {
return (
<EmployeeOnboarding.SelfOnboardingFlow
companyId="a007e1ab-3595-43c2-ab4b-af7a5af2e365"
employeeId="4b3f930f-82cd-48a8-b797-798686e12e5e"
withEmployeeI9
onEvent={(eventType: EventType) => {
if (eventType === 'employee/onboarding/done') {
// Onboarding complete — navigate to your next screen
}
}}
/>
)
}
SelfOnboardingFlowProps
Props for SelfOnboardingFlow.
| Property | Type | Description |
|---|---|---|
companyId | string | The associated company identifier. |
employeeId | string | The associated employee identifier. |
onEvent | OnEventType<EventType, unknown> | Callback invoked each time the component emits an event — user interactions, successful API responses, step transitions, or errors. Receives the event type constant and an optional payload whose shape varies by event. See the Event Handling guide and each component's event table for the full list of emitted events. |
withEmployeeI9? | boolean | When true, the Document Signer step checks if the employee has I-9 enabled and routes to the Employment Eligibility and I-9 signature form steps. Defaults to false. |
Inherits children, className, defaultValues, dictionary, FallbackComponent, LoaderComponent from BaseComponentInterface.
Sub-components
| Component | Description |
|---|---|
| Landing | Landing page for the employee self-onboarding flow. Displays a welcome message and the list of onboarding steps the employee needs to complete. |
| Profile | Onboarding step for collecting an employee's basic profile and addresses. |
| FederalTaxes | Onboarding step for collecting an employee's federal tax (W-4) withholdings — filing status, multiple-jobs flag, dependents, other income, deductions, and extra withholding. |
| StateTaxes | Onboarding step that collects an employee's per-state tax withholding answers. The set of fields is driven by the API response for each state on record. |
| PaymentMethod | Onboarding step for setting up an employee's payment method. |
| DocumentSigner | Onboarding step for signing employee documents. |
| OnboardingSummary | Displays a summary of an employee's onboarding status, listing completed and outstanding steps. Rendered as a standalone step inside OnboardingFlow. |
Step flow
The employee completes their own onboarding, starting from the self-onboarding landing page.