> For the complete documentation index, see [llms.txt](https://docs.lambahq.com/llms.txt). Markdown versions of documentation pages are available by appending `.md` to page URLs; this page is available as [Markdown](https://docs.lambahq.com/documentation/lamba-ui-js-client/listening-for-events.md).

# Listening for Events

Learn how to listen for events emitted for each action executed by each Lamba services

{% hint style="info" %}
**Helpful tip:** events are always emitted on the Lamba UI whenever an action is successfully executed
{% endhint %}

## Listening for emitted events

The code snippet below shows how you can listen for events emitted by the Lamba JS library:

```javascript
lamba.on('name_of_emitted_event',(data)=>{
   console.log('actionId...',data.id);
});
```

The `data` emitted contains the `id` of the action stored on Lamba. You can use the id to query the Lamba API to get the status and other information about that action performed.

**Kind of events emitted in the Lamba UI:**

| Event Name        | Description                                                                         |
| ----------------- | ----------------------------------------------------------------------------------- |
| `emailSent`       | returns the id of action for the sent email as `{id: "action_id_here..."}`          |
| `smsSent`         | returns the id of action for the sent SMS as `{id: "action_id_here..."}`            |
| `paymentVerified` | returns the id of action for the payment transaction as `{id: "action_id_here..."}` |
