agora-rtc-sdk-ng
Version:
Agora WebRTC SDK for JavaScript
67 lines (46 loc) • 2.07 kB
Markdown
English | [简体中文](https://github.com/AgoraIO/agora-rtc-web/blob/main/README-zh_CN.md)
Use `npm`, `pnpm` or `yarn`
```bash
npm i agora-rtc-sdk-ng
pnpm add agora-rtc-sdk-ng
yarn add agora-rtc-sdk-ng
```
CDN is also provided. The SDK exports a global `AgoraRTC` object.
```html
<!-- default UMD, no AI QoS -->
<script src="https://download.agora.io/sdk/release/AgoraRTC_N-4.24.8.js"></script>
```
To use AI QoS from CDN, load the full UMD instead. AI is already registered; only this one script is needed:
```html
<script src="https://download.agora.io/sdk/release/AgoraRTC_N-4.24.8-full.js"></script>
<script>
const client = AgoraRTC.createClient({ mode: "live", codec: "vp8", aiClientMode: true });
await client.join(appId, channel, token, uid);
</script>
```
npm UMD is the same split. Default has no AI QoS; `agora-rtc-sdk-ng/full` is the complete build:
```javascript
import AgoraRTC from "agora-rtc-sdk-ng/full";
const client = AgoraRTC.createClient({ mode: "live", codec: "vp8", aiClientMode: true });
await client.join(appId, channel, token, uid);
```
ESM is unchanged: import the main ESM, then the optional service:
```javascript
import AgoraRTC from "agora-rtc-sdk-ng/esm";
import { AiAudioModeService } from "agora-rtc-sdk-ng/services/ai-audio-mode";
AgoraRTC.use(AiAudioModeService);
const client = AgoraRTC.createClient({ mode: "live", codec: "vp8", aiClientMode: true });
await client.join(appId, channel, token, uid);
```
`React`, `Vue`, `Svelte` quick start demo are provided, please check at [Quick Start Demo](https://github.com/AgoraIO/agora-rtc-web/blob/main/projects).
We also have [More Demos](https://github.com/AgoraIO/API-Examples-Web/tree/main/Demo).
Please follow the documentation at [api-ref.agora.io](https://api-ref.agora.io/en/voice-sdk/web/4.x/index.html).
Please check the changelogs at [Release Notes](https://docs.agora.io/en/video-calling/overview/release-notes?platform=web).