> ## Documentation Index
> Fetch the complete documentation index at: https://developers.telnyx.com/llms.txt
> Use this file to discover all available pages before exploring further.

# WebRTC JS Notification

> Reference for the INotification interface in the JS Voice SDK — the event payload Telnyx dispatches to notify the client of session and call changes.

An event dispatched by Telnyx to notify the client of changes to the session or call.

The conditions of the event can be identified by the `type` property.

| `type`           | Description                                                  | Additional properties |
| ---------------- | ------------------------------------------------------------ | --------------------- |
| `callUpdate`     | A call has changed state                                     | `call`                |
| `userMediaError` | The browser does not have permission to access media devices | `error`               |

**`Examples`**

Usage with TelnyxRTC Client `.on`:

```js theme={null}
client.on('telnyx.notification', (notification) => {
  if (notification.type === 'callUpdate') {
    console.log(notification.call);

    // Do something with the call and update UI accordingly
  } else if (notification.type === 'userMediaError') {
    console.log(notification.error);

    // Handle the error and update UI accordingly
  }
});
```

### Data structure

The notification structure is determined by its `type`.

#### `callUpdate`

```js theme={null}
{
  type: 'callUpdate',
  call: Call // current call
}
```

#### `userMediaError`

```js theme={null}
{
  type: 'userMediaError',
  error: Error
}
```

**`Apialias`**

Notification

## Hierarchy

* `Omit`\<`INotificationEventData`, `"call"`>

  ↳ **`INotification`**

## Table of contents

### Properties

* [call](#call)
* [error](#error)
* [type](#type)

## Properties

### call

• `Optional` **call**: [`Call`](https://github.com/team-telnyx/webrtc/tree/main/packages/js/docs/ts/classes/Call.md)

The current call. Reference this call state to update your UI.
See `Call` documentation.

***

### error

• `Optional` **error**: `Error`

Error from the `userMediaError` event.
Check your `audio` and `video` constraints for browser support.

#### Overrides

Omit.error

***

### type

• **type**: `string`

Identifies the event case.

#### Overrides

Omit.type
