Documentation Index
Fetch the complete documentation index at: https://gusto-preview.mintlify.app/llms.txt
Use this file to discover all available pages before exploring further.
Using events
Each of our React SDK components ships with anonEvent property. This is a function callback that is supplied with the event type and data associated with the user action. It takes the form:
eventType argument will be one of the constants from componentEvents, which can be imported from the top level SDK import identical to any of the other exported components or utilities.
The data argument can vary in shape and content. Some events will have no data and will simply indicate that a user is done with a step and is proceeding to the next step in the flow. When data is included it is typically the response from the associated API call. For example, when the EmployeeCreated event is fired, it is called with the response data from the create an employee endpoint.
You can supply a function to this callback and respond to events as needed. In the following example we set up an event handler for the Employee.Profile component and execute code based on the event type:
Employee Onboarding Workflow. You can also view the docs in the Workflows Overview section for events relating to each flow.
What’s Next