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:

ArgumentsDescription
eventThe event name.
dataAdditional 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.

📘

Testing SDK Events

Frontend tip: if you want visibility into the SDK events dispatched by Check Components, simply drop this line in the web console: window.addEventListener('message', e => console.log(e.data))

Default Component Events

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

EventDescription
check-component-app-loadedThis event is emitted when the Component URL is embedded successfully in the DOM.

Common Component Events

EventDescription
check-component-company-signatory-agreements-completeThis event is potentially emitted from many components that will prompt the company to sign Check's TOS & Debit Authorization if they haven't done so before. More specifically, this is likely to be seen in the Setup components.
check-component-company-terms-of-service-completeThis event is potentially emitted from many components that will prompt the company to sign Check's TOS if they haven't done so before.

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:

EventComponent (s)Description
check-component-employee-withholdings-setup-completeEmployee Withholding SetupEmits an event when all the withholdings are set and tax forms signed.
check-component-employee-ssn-setup-completeEmployee SSN SetupEmits an event when an employee's SSN is added.
check-component-employee-payment-setup-completeEmployee Payment SetupEmits an event when an employee has set up their payment method.
check-component-employee-bank-account-updatedEmployee Payment SetupEmits an event when an employee's bank account is updated.
check-component-employee-payment-setup-already-completeEmployee Payment SetupEmits an event when the Component is loaded and the employee has already set up their payment.
check-component-employee-paystub-downloadedEmployee PaystubsEmits an event when an employee downloads a paystub.
check-component-employee-tax-document-downloadedEmployee Tax DocumentsEmits an event when an employee downloads a tax document.
check-component-company-payment-setup-completeCompany Payment SetupEmits an event when a company's bank account is added.
check-component-company-bank-account-updatedCompany Payment SetupEmits an event when a company's bank account is updated.
check-component-company-payment-setup-already-completeCompany Payment SetupEmits an event when the Component is loaded and the company has already set up their payment.
check-component-company-tax-setup-completeCompany Tax SetupEmits an event when a company sets up their tax info.
check-component-company-filing-authorization-completeCompany Filing AuthorizationEmits an event when a company's filing authorization forms are complete.
check-component-company-details-completeCompany Details (KYB)Emits an event when a company inputs all their business details for KYB purposes.
check-component-company-tax-document-downloadedCompany Tax DocumentsEmits an event when a company downloads a tax document.
check-component-company-authorization-document-downloadedCompany Authorization DocumentsEmits an event when a company downloads an authorization document.
check-component-contractor-tax-document-downloadedContractor Tax DocumentsEmits an event when a contractor downloads a tax document.
check-component-previous-provider-access-completeCompany Previous Provider Access, Full Service Setup SubmissionEmits an event when a company submits their selected previous provider access method.
check-component-company-connect-bank-account-completeConnect Bank Account, Full Service Setup SubmissionEmits an event when a company has successfully connected their bank account.
check-component-company-terms-of-service-already-completeTerms of ServiceEmits an event if the Terms of Service component is loaded and the company has already previously signed.
check-component-early-enrollment-completeEarly EnrollmentEmits an event when the company has finished providing the necessary information in the Early Enrollment Component.
check-component-verification-document-completeVerification DocumentsEmits an event when a company has supplied all of the necessary verification documents.
check-component-pay-history-reopenedPay HistoryEmits an event when a company re-opens their year-to-date pay history submission to edit their data
check-component-pay-history-completePay HistoryEmits an event when a company indicates that they've finished providing all of their year-to-date pay history data.
check-component-pay-history-payroll-submittedPay HistoryEmits an event when a user successfully submits a historical payroll.
check-component-pay-history-payroll-unsubmittedPay HistoryEmits an event when a user successfully unsubmits a historical payroll.
check-component-pay-history-deletedPay HistoryEmits an event when a user successfully deletes a historical payroll.
check-component-setup-submission-completeFull Service Setup SubmissionEmits an event when a user has completed the necessary prerequisites and successfully submits themselves for a Full Service Embedded Setup.
check-component-new-to-payroll-indicatedFull Service Setup SubmissionEmits an event when a user has indicated that this is their first time paying people. This should be used as a trigger to close the component as it can't be used for companies new to payroll.
check-component-business-details-completeBusiness DetailsEmits an event when a user has finished submitting or editing their company details.
check-component-team-setup-workplace-setup-completeTeam SetupEmits an event when a user has finished creating all of their workplaces in the Team Setup flow.
check-component-team-setup-employee-setup-completeTeam SetupEmits an event when a user has finished creating all of their employees in the Team Setup flow.
check-component-team-setup-contractor-setup-completeTeam SetupEmits an event when a user has finished creating all of their contractors in the Team Setup flow.
check-component-team-setup-completeTeam SetupEmits an event when a user has completed the entire Team Setup flow.