Handling Component Events

Check Components emit events to signal important state changes. When instantiating the Check Component SDK, your app can listen for these events by passing an onEvent handler.

const handler = window.CheckComponent.create({
  link: componentLink,
  onEvent: (event, data) => {
    // handle Check Component events
  },
});

Below is a list of arguments the onEvent function takes in:

Arguments

Description

event

The event name.

data

Additional data (if any) for the event.

Component events can be used to trigger another workflow or spin up other Components. For example, you can tie together the Tax Setup and Payment Setup Components by surfacing the Payment Setup Component only after the check-component-tax-setup-complete event is detected.

Default Component Events

Each Component will always emit the following event(s):

Event

Description

check-component-app-loaded

This event is emitted when the Component URL is embedded successfully in the DOM.

Additional Component Events

Some Components emit additional events to signal changes such as a form submission or a bank account update. Below is a list of Events and the Components that emit them:

Event

Component

Description

check-component-employee-withholdings-setup-complete

Employee Withholding Setup

Emits an event when all the withholdings are set and tax forms signed.

check-component-employee-ssn-setup-complete

Employee SSN Setup

Emits an event when an employee's SSN is added.

check-component-employee-payment-setup-complete

Employee Payment Setup

Emits an event when an employee has set up their payment method.

check-component-employee-bank-account-updated

Employee Payment Setup

Emits an event when an employee's bank account is updated.

check-component-employee-payment-setup-already-complete

Employee Payment Setup

Emits an event when the Component is loaded and the employee has already set up their payment.

check-component-employee-paystub-downloaded

Employee Paystubs

Emits an event when an employee downloads a paystub.

check-component-company-payment-setup-complete

Company Payment Setup

Emits an event when a company's bank account is added.

check-component-company-bank-account-updated

Company Payment Setup

Emits an event when a company's bank account is updated.

check-component-company-payment-setup-already-complete

Company Payment Setup

Emits an event when the Component is loaded and the company has already set up their payment.

check-component-company-tax-setup-complete

Company Tax Setup

Emits an event when a company sets up their tax info.

check-component-company-filing-authorization-complete

Company Filing Authorization

Emits an event when a company's filing authorization forms are complete.

check-component-company-details-complete

Company Details (KYB)

Emits an event when a company inputs all their business details for KYB purposes.


Did this page help you?