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

# on()

> Listen for events from the ChainPatrol Relay.

## Example

```js theme={null}
import { Relay, Events } from "@chainpatrol/sdk";

Relay.on(Events.ContinueAtOwnRisk, (request) => {
  // Handle the event
});
```

## Parameters

The `on()` method accepts two parameters:

<ParamField body="type" type="EventType" required>
  The `type` property specifies what type of event you want to listen for.
</ParamField>

<ParamField body="callback" type="(data: EventData) => void" required>
  The `callback` property is a function that will be called when the event is
  triggered. The event data is passed to the callback function as the first
  parameter.
</ParamField>
