Getting Started
Installation
Using a package manager
Use your favourite package manager to install:
- npm
- Yarn
- pnpm
npm install --save @agoralabs-sh/avm-web-provider
yarn add @agoralabs-sh/avm-web-provider
pnpm add @agoralabs-sh/avm-web-provider
Download via a CDN
Include the minified browser bundle directly in your HTML like so:
<html>
...
<script src="https://github.com/agoralabs-sh/avm-web-provider/releases/latest/download/avm-web-provider.min.js"></script>
...
</html>
Initialization
Firstly, we want to initialize the AVM web provider with an ID:
- JavaScript (via package manager)
- JavaScript (via CDN)
- TypeScript
const { AVMWebProvider } = require('@agoralabs-sh/avm-web-provider');
const provider = AVMWebProvider.init('02657eaf-be17-4efc-b0a4-19d654b2448e');
var provider = window.AVMWebProviderSDK.AVMWebProvider.init();
import { AVMWebProvider } from '@agoralabs-sh/avm-web-provider';
const provider: AVMWebProvider = AVMWebProvider.init('02657eaf-be17-4efc-b0a4-19d654b2448e');
note
The provider ID is what will identify your provider with clients. It is recommended that you use a UUIDv4 compliant string.
note
See IAVMWebProviderInitOptions
for more information on what options are supported.