---
title: "Typer"
description: "Learn how to use Sentry to capture Typer exceptions."
url: https://docs.sentry.io/platforms/python/integrations/typer/
---

# Typer | Sentry for Python

The `TyperIntegration` captures exceptions raised when using [Typer CLI](https://typer.tiangolo.com/) applications.

## [Install](https://docs.sentry.io/platforms/python/integrations/typer.md#install)

Install Typer and the Sentry Python SDK.

```bash
pip install "sentry-sdk" "typer"
```

## [Configure](https://docs.sentry.io/platforms/python/integrations/typer.md#configure)

To enable the `TyperIntegration`, add it to the `integrations` list of your `sentry_sdk.init`.

```python
import sentry_sdk
from sentry_sdk.integrations.typer import TyperIntegration

sentry_sdk.init(
    dsn="___PUBLIC_DSN___",
    # Add data like request headers and IP for users, if applicable;
    # see https://docs.sentry.io/platforms/python/data-management/data-collected/ for more info
    send_default_pii=True,
    integrations=[TyperIntegration()],
)
```

## [Verify](https://docs.sentry.io/platforms/python/integrations/typer.md#verify)

Create a small CLI application:

```python
import typer
import sentry_sdk
from sentry_sdk.integrations.typer import TyperIntegration

sentry_sdk.init(...)  # see above

def main():
    1 / 0

if __name__ == "__main__":
    typer.run(main)
```

When you run this, Sentry will capture the `ZeroDivisionError` from the `main()` function and you'll be able to see it on [sentry.io](https://sentry.io).
