# [LiveDigital](https://livedigital.space/) SDK
[![GitHub license](https://img.shields.io/badge/license-MIT-blue.svg)](https://choosealicense.com/licenses/mit/) [![npm version](https://img.shields.io/npm/v/@livedigital/client.svg?style=flat)](https://www.npmjs.com/package/@livedigital/client) ![release](https://github.com/vlprojects/livedigital-sdk/actions/workflows/release.yml/badge.svg)

## Installation

Use the package manager [npm](https://pip.pypa.io/en/stable/) or [yarn](https://yarnpkg.com/) to install livedigital-client.

```bash
yarn add @livedigital/client
```

## Usage

```
import Client from '@livedigital/client';

const client = new Client();
```

## Plugins
Now you can use the noise reduction and virtual backgrounds functionality. To do this, copy all the files from the
/files directory to the root directory of your project. Or your can specify the path in Client param staticFilesPath
And add tsvb-web.js scripts to your index.html
```
<script src="%PUBLIC_URL%/esdk/3.5.8/tsvb-web.js"></script>
```

## Development
### Submodules

To pull submodules required for the library build, use these commands:

```shell
git pull --recurse-submodules
git submodule update --init --recursive
```

## Debugging
### Log Levels
LiveDigital client uses the [debug](https://www.npmjs.com/package/debug) module to log to the browser console.

There are three log severities:

- **debug**: verbose information logged to console.info
- **warn**: warning messages logged to console.warn
- **error**: error messages logged to console.error

All the logs generated by LiveDigital client have a namespace starting with “LiveDigital”
plus colon, followed by the log severity in upper case plus colon (just if “warn” or “error”),
and followed by the internal component name (if any) and the log message.

### Enable Logging
By default, logging is turned off. In order to enable it, the debug key in the browser's
localStorage must be set.
>Check the [debug](https://www.npmjs.com/package/debug) module documentation for further information regarding how to filter specific log messages based on namespace matching rules.

### Example
Within the <head> section of your HTML app:
```
<script>
  window.localStorage.setItem('debug', 'LiveDigital:*');
</script>

<script src='/js/your-bundled-app.js'></script>
```

## Contributing
Pull requests are welcome. For major changes, please open an issue first to discuss what you would like to change.

## License
[MIT](https://choosealicense.com/licenses/mit/)
