---
url: https://undevice.hacks.run/api/functions/undevice.md
---
[undevice](../index.md) / undevice

# Function: undevice()

> **undevice**<`T`>(`extensions?`): `Readonly`<{ `detect`: (`options`) => [`UndeviceResult`](../type-aliases/UndeviceResult.md)<`T`>; }>

Defined in: [undevice.ts:19](https://github.com/teplostanski/undevice/blob/e23a78421710958df6c38902428aa8e6d1753c05/src/core/undevice.ts#L19)

Creates a reusable detector with optional custom boolean flags.
Each call to `detect` returns a new frozen result for the supplied request.

## Type Parameters

### T

`T` *extends* `Extensions` = `Record`<`never`, `never`>

## Parameters

### extensions?

`T`

Named callbacks, substring arrays, or checks with exclusions.

## Returns

`Readonly`<{ `detect`: (`options`) => [`UndeviceResult`](../type-aliases/UndeviceResult.md)<`T`>; }>

## Example

```ts
const { detect } = undevice({ isRawClient: ['curl', 'wget'] })
const device = detect({ userAgent: 'curl/8.0' })
```
