> ## Documentation Index
> Fetch the complete documentation index at: https://browseruse-0aece648-mintlify-cli-docs-1773354647.mintlify.site/llms.txt
> Use this file to discover all available pages before exploring further.

# Events

> Monitor execution with callbacks

## Live Browser View

```python theme={null}
@sandbox(on_browser_created=lambda data: print(f'👁️  {data.live_url}'))
async def task(browser: Browser):
    agent = Agent(task="your task", browser=browser, llm=ChatBrowserUse())
    await agent.run()
```

## All Events

```python theme={null}
from browser_use.sandbox import BrowserCreatedData, LogData, ResultData, ErrorData

@sandbox(
    on_browser_created=lambda data: print(f'Live: {data.live_url}'),
    on_log=lambda log: print(f'{log.level}: {log.message}'),
    on_result=lambda result: print('Done!'),
    on_error=lambda error: print(f'Error: {error.error}'),
)
async def task(browser: Browser):
    # Your code
```

All callbacks can be sync or async.
