Sample code
Sample code
Download
Here we provide you with a sample application to experience the ZEGOCLOUD's Super Board, and the following describes how to run the sample code.
Prerequisites
- Use a browser that the SDK supports:
| Platform | Browser/Webview | Description |
|---|---|---|
| Windows | Chrome | Supports win7 or later |
| macOS | Chrome | Supports macOS 10.10 or later |
| iOS | Safari | Supports iOS 10.0 or later |
| iOS | Built-in WeChat browser | Supports iOS 10.0 or later |
| Android | Chrome | Supports Android 8.0 or later |
| Android | Built-in WeChat browser | Supports Android 8.0 or later |
- Contact the ZEGOCLOUD Technical support to get the AppID and ServerSecret for SDK integration.
- Get the Token (v3) that SDK required for authentication. For details, see Generate a token(v3).
Warning
- By default, the features of this product are not enabled. To use these features, you will need to contact ZEGOCLOUD Technical Support to enable them first.
- For SDK version
2.3.0 or later, you can also use Tokens for authentication. To upgrade the authentication mode, refer to the Upgrade the authentication mode from AppSign to Token.
Run the sample code
- In the
js/login/init.jsfile, fill in the AppID, Server URL, and Token (v3) which you get in the Prerequisites steps.
var zegoEnvConfig = {
appID: 0, // fill in your AppID
server: '', // fill in your Server URL
token: '' // fill in your Token (v3)
};- Open the
index.htmlpage under your project directory, enter the room ID and userID to log in to a room.

