Lemon.js

Handling Events

Handling overlay events with Lemon.js is easy-peasy. Overlay events are triggered by actions from within the Checkout and Payment Method Update overlays themselves.

You can listen to the overlay events easily with a few lines of code. You'll need to make sure you've got the Lemon.js library installed on your page first.

Every time an event is fired from the Overlay,

LemonSqueezy.Setup({ eventHandler: (event) => { // Do whatever you want with this event data } })

Overlays events conform to a specific format. Any additional data will be included in the data object section of the event, but it may not always be present.

{ event: 'Event.Name', data: { ... additional data here } }

List of Events

Lemon.js currently supports the following events:

EventDescription
PaymentMethodUpdate.MountedPayment Method Update Overlay has been loaded
PaymentMethodUpdate.ClosedPayment Method Update Overlay has been closed
PaymentMethodUpdate.UpdatedPayment method has been updated successfully
Checkout.SuccessCheckout was successful

Can't find the event you're looking for? You can always ask us to add it.

Previous
Opening Overlays