Skip to main content
Layer’s React components emit UI events when users interact with them. Subscribe to these events through the onEvent callback on <LayerProvider>’s eventCallbacks prop to power analytics, custom logging, or to react to user activity in your own application.
The onEvent callback fires when users interact with embedded Layer components. Each event includes a type, version, event-specific payload, and metadata.

Event Structure

The LayerEventType value, LayerEventComponent value, and LayerEvent type are exported from @layerfi/components for TypeScript users. LayerEvent is a discriminated union, so checking event.type narrows event.payload to the payload for that event.

Supported Events

All events listed below currently use version: 1.

Tasks Events

Fired when a user selects a month in the Tasks component.
Fired when a user selects a year in the Tasks component.
Fired when a user clicks on a task to expand or collapse it.

Bookkeeping Events

Fired when a user clicks the button to schedule a call with a bookkeeper.

Profit and Loss Events

Fired when a user selects a month on the Profit and Loss chart.

Transactions Events

Fired when a user submits a search query in the Bank Transactions component.
Fired when a user clicks to download transactions.
Fired when a user saves a memo or description for a transaction.
Fired when a user initiates a receipt upload for a transaction.
Fired when a user navigates to a different page in the Bank Transactions list.

Reports Events

Fired when a user navigates to a different report in the Unified Reports view.
Fired when a user clicks to download a report.
Fired when a user expands or collapses a section in a report table.

Linked Accounts Events

Fired when a user clicks to add a new linked account.
Fired when a user confirms unlinking a bank account.

Example Usage