# mux-data

Options for the Mux Data extension that monitors playback quality

Adds the [Mux Data](https://data.mux.com) [extension](../../guides/architecture.md) to the player’s media. It renders nothing — place it inside the player as a sibling of the media element. See [Mux Data](../../guides/mux-data.md) for how monitoring works.

## Import

```bash
pnpm add @videojs/html @videojs/mux-data
```

```ts
import '@videojs/html/extensions/mux-data';
```

Or load it from the [CDN](../../guides/cdn.md):

```html
<script type="module" src="https://cdn.jsdelivr.net/npm/@videojs/cdn@10.0.0-rc.3/extensions/mux-data.js"></script>
```

## Anatomy

```html
<mux-data></mux-data>
```

## Options

| Attribute | Property | Description |
| --- | --- | --- |
| `env-key` | `envKey` | Mux Data environment key the beacons are sent to. Optional for Mux-hosted playback |
| — | `metadata` | Mux Data metadata for the view |
| `player-software-name` | `playerSoftwareName` | Player name reported to Mux Data |
| `player-software-version` | `playerSoftwareVersion` | Player version reported to Mux Data. Defaults to the Video.js version |
| `player-init-time` | `playerInitTime` | Epoch milliseconds the player was initialized. Defaults to when the element was created |
| `beacon-collection-domain` | `beaconCollectionDomain` | Custom domain the beacons are sent to |
| `disable-cookies` | `disableCookies` | Stops the SDK from setting cookies |
| `debug` | `debug` | Turns on SDK debug logging |
| — | `MuxDataSdk` | SDK used for monitoring. Set it to `undefined` to switch monitoring off |

`metadata` and `MuxDataSdk` take objects, so they’re properties only, with no matching attribute.

Changing `MuxDataSdk`, `beaconCollectionDomain`, `debug`, or `disableCookies` restarts monitoring, which ends the current view and starts a new one. The rest update the view in place.

## See also

- [Mux Data](../../guides/mux-data.md): How monitoring works
- [Mux video reference](./mux-video.md)
- [Mux audio reference](./mux-audio.md)