# posthog

Python API: `luxonis_ml.telemetry.backends.posthog`

## Classes

| Name | Description |
| --- | --- |
|
[`PostHogBackend`](https://docs.luxonis.com/software-v3/ai-inference/model-source/training/luxonis-ml/luxonis-ml-api-reference/telemetry/backends/posthog.md)
| PostHog backend using the official python package. |

### class `PostHogBackend`

```python
class PostHogBackend(TelemetryBackend)
```

PostHog backend using the official python package.

Methods

| Name | Description |
| --- | --- |
|
[`__init__`](https://docs.luxonis.com/software-v3/ai-inference/model-source/training/luxonis-ml/luxonis-ml-api-reference/telemetry/backends/posthog.md)
| Initialize the PostHog client. |
|
[`capture`](https://docs.luxonis.com/software-v3/ai-inference/model-source/training/luxonis-ml/luxonis-ml-api-reference/telemetry/backends/posthog.md)
| Capture an event using the PostHog client. |
|
[`flush`](https://docs.luxonis.com/software-v3/ai-inference/model-source/training/luxonis-ml/luxonis-ml-api-reference/telemetry/backends/posthog.md)
| Flush buffered PostHog events if supported. |

#### method `__init__`

```python
def __init__(config: TelemetryConfig)
```

Initialize the PostHog client.

Args

| Name | Type | Description | Default |
| --- | --- | --- | --- |
| `config` | `TelemetryConfig` | Telemetry backend configuration. | required |

Raises

| Type | Description |
| --- | --- |
| `ValueError` | If the PostHog API key is missing. |
| `ImportError` | If the `posthog` package is not installed. |

#### method `capture`

```python
def capture(event: TelemetryEvent)
```

Capture an event using the PostHog client.

#### method `flush`

```python
def flush()
```

Flush buffered PostHog events if supported.

## Module Attributes

| Name | Description |
| --- | --- |
|
[`PROTECTED_POSTHOG_PROPERTY_KEYS`](https://docs.luxonis.com/software-v3/ai-inference/model-source/training/luxonis-ml/luxonis-ml-api-reference/telemetry/backends/posthog.md)
| |

### constant `PROTECTED_POSTHOG_PROPERTY_KEYS`

```python
PROTECTED_POSTHOG_PROPERTY_KEYS = frozenset({*RESERVED_METADATA_KEYS, 'schema_version'})
```
