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.
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):
Event | Description |
---|---|
check-component-app-loaded | This event is emitted when the Component URL is embedded successfully in the DOM. |
Common Component Events
Event | Description |
---|---|
check-component-company-signatory-agreements-complete | This 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-complete | This 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:
Event | Component (s) | 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-employee-tax-document-downloaded | Employee Tax Documents | Emits an event when an employee downloads a tax document. |
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. |
check-component-company-tax-document-downloaded | Company Tax Documents | Emits an event when a company downloads a tax document. |
check-component-company-authorization-document-downloaded | Company Authorization Documents | Emits an event when a company downloads an authorization document. |
check-component-contractor-tax-document-downloaded | Contractor Tax Documents | Emits an event when a contractor downloads a tax document. |
check-component-previous-provider-access-complete | Company Previous Provider Access, Full Service Setup Submission | Emits an event when a company submits their selected previous provider access method. |
check-component-company-connect-bank-account-complete | Connect Bank Account, Full Service Setup Submission | Emits an event when a company has successfully connected their bank account. |
check-component-company-terms-of-service-already-complete | Terms of Service | Emits an event if the Terms of Service component is loaded and the company has already previously signed. |
check-component-early-enrollment-complete | Early Enrollment | Emits an event when the company has finished providing the necessary information in the Early Enrollment Component. |
check-component-verification-document-complete | Verification Documents | Emits an event when a company has supplied all of the necessary verification documents. |
check-component-pay-history-reopened | Pay History | Emits an event when a company re-opens their year-to-date pay history submission to edit their data |
check-component-pay-history-complete | Pay History | Emits 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-submitted | Pay History | Emits an event when a user successfully submits a historical payroll. |
check-component-pay-history-payroll-unsubmitted | Pay History | Emits an event when a user successfully unsubmits a historical payroll. |
check-component-pay-history-deleted | Pay History | Emits an event when a user successfully deletes a historical payroll. |
check-component-setup-submission-complete | Full Service Setup Submission | Emits 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-indicated | Full Service Setup Submission | Emits 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-complete | Business Details | Emits an event when a user has finished submitting or editing their company details. |
check-component-team-setup-workplace-setup-complete | Team Setup | Emits an event when a user has finished creating all of their workplaces in the Team Setup flow. |
check-component-team-setup-employee-setup-complete | Team Setup | Emits an event when a user has finished creating all of their employees in the Team Setup flow. |
check-component-team-setup-contractor-setup-complete | Team Setup | Emits an event when a user has finished creating all of their contractors in the Team Setup flow. |
check-component-team-setup-complete | Team Setup | Emits an event when a user has completed the entire Team Setup flow. |
Updated 15 days ago