[youtubei.js](../../../../README.md) / [Utils](../README.md) / getRandomUserAgent

# Function: getRandomUserAgent()

> **getRandomUserAgent**(`type`): `string`

Defined in: [src/utils/Utils.ts:100](https://github.com/LuanRT/YouTube.js/blob/0733f60b57877f6b8b87dfd5cc6195b5085f5c09/src/utils/Utils.ts#L100)

Returns a random user agent.

## Parameters

### type

[`DeviceCategory`](../type-aliases/DeviceCategory.md)

mobile | desktop

## Returns

`string`
