# parseDevice

**Kind:** Function

**Source:** [`atloria-monorepo/apps/api/src/analytics/utils/tracking-utils.ts`](https://github.com/sherkety/atloria/blob/main/atloria-monorepo/apps/api/src/analytics/utils/tracking-utils.ts#L60)

Derive a coarse device class from the user-agent string. Order matters:
we check mobile first (since "Android Mobile" includes both keywords),
then tablet, then desktop, then fall back to unknown.

## Signature

```ts
function parseDevice(userAgent: string | null | undefined): DeviceClass
```

## Parameters

| Name | Type |
|---|---|
| `userAgent` | `string | null | undefined` |

**Returns:** `DeviceClass`
