> ## Documentation Index
> Fetch the complete documentation index at: https://docs.methodfi.com/llms.txt
> Use this file to discover all available pages before exploring further.

# Events Overview

> [!WARNING]
>
> Method Elements will no longer be supported or maintained beginning December
> 31st, 2025. We recommend using [Method Opal](https://docs.methodfi.com/opal/overview.md) for all new
> integrations. If you are currently using Elements, please reach out to your
> CSM to discuss your migration options.

Communication between the Element and your app can be handled either by PostMessage communication or via HTTP redirects.

## Listening to Events

We strongly recommend using one of the [Element SDKs](https://docs.methodfi.com/elements/libraries.md) to make listening to events easy. They provide you with callback functions that are invoked every time a specific type of event occurs (such as `open`, `success`, `exit`, etc).

Each type of Element will emit its own events. See [General Events](https://docs.methodfi.com/elements/events/general_events.md) and [Element Specific Events](https://docs.methodfi.com/elements/events/specific_events.md) for more information about the events that are emitted.

### PostMessage without SDK

To receive events via PostMessage, pass the query parameter `event_channel=message` to the Elements url. For example:

```bash theme={null}
https://elements.production.methodfi.com
  ?token=pk_elem_4PpMTPcchb49VBjwP3bREKhMN93hrQHR
  &event_channel=message
```

To listen to the emitted events, add an event listener onto the window object:

```javascript theme={null}
window.addEventListener('message', function(event) {
  const { payload, type } = event.data;
  console.log('Received event!', type, payload);
});
```

### Redirects

Redirects are the default way of listening to element events if you are not using one of the SDKs. Your webview / app should intercept the redirects in order to react accordingly to state changes. All redirect URLs will have the scheme ("prefix") `methodelements`. The event source will be the URL host and the payload will be query strings.

HTTP redirects from Method Elements are in the following format:

```bash theme={null}
methodelements://{event_source}?{event_data}
```


This documentation is built and hosted on [Mintlify](https://mintlify.com), a developer documentation platform.