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

# Events

> SDK reference for the Events resource (TypeScript & Python)

## Wait for Event

`POST /v1/events/{event_name}/wait` — waitForEvent

<CodeGroup>
  ```typescript TypeScript theme={null}
  import { client, Events } from 'anchorbrowser';

  // ANCHORBROWSER_API_KEY is read from the environment by default;
  // set it explicitly like this:
  client.setConfig({ auth: () => 'your-api-key' });

  const result = await Events.waitForEvent({
    path: {
      event_name: 'your-event-name'
    }
  });
  console.log(result);
  ```

  ```python Python theme={null}
  from anchorbrowser import Anchorbrowser

  # ANCHORBROWSER_API_KEY is read from the environment by default;
  # set it explicitly with Anchorbrowser(api_key="your-api-key")
  client = Anchorbrowser()

  result = client.events.wait_for_event(
      "your-event-name",
  )
  print(result)
  ```
</CodeGroup>

## Signal Event

`POST /v1/events/{event_name}` — signalEvent

<CodeGroup>
  ```typescript TypeScript theme={null}
  import { client, Events } from 'anchorbrowser';

  // ANCHORBROWSER_API_KEY is read from the environment by default;
  // set it explicitly like this:
  client.setConfig({ auth: () => 'your-api-key' });

  const result = await Events.signalEvent({
    path: {
      event_name: 'your-event-name'
    },
    body: {
      data: {
        message: 'Task completed',
        result: 'success',
        timestamp: '2024-01-01T12:00:00Z'
      }
    }
  });
  console.log(result);
  ```

  ```python Python theme={null}
  from anchorbrowser import Anchorbrowser

  # ANCHORBROWSER_API_KEY is read from the environment by default;
  # set it explicitly with Anchorbrowser(api_key="your-api-key")
  client = Anchorbrowser()

  result = client.events.signal_event(
      "your-event-name",
      data={
          "message": "Task completed",
          "result": "success",
          "timestamp": "2024-01-01T12:00:00Z"
      },
  )
  print(result)
  ```
</CodeGroup>
