---
url: https://docs.moqtail.dev/ts/api/player/worker/functions/serveWorker.md
---
# Function: serveWorker()

> **serveWorker**(`engines?`): `void`

Serves the player's worker from the script it runs: the built-in engines, plus `engines` by the
name of the element that creates them. Pass the script to the player's `worker` option.

## Parameters

### engines?

`Record`<`string`, [`EngineClass`](../type-aliases/EngineClass.md)> = `{}`

## Returns

`void`

## Throws

TypeError for a name with whitespace, or one a built-in engine has.
