Getting Started
Environment Requirements
Table 1 describes the operating environment requirements of the web SDK.
Item |
Constraint |
---|---|
Development tool |
Microsoft Visual Studio Code, WebStorm, or other web IDE development tools |
Language |
JavaScript or TypeScript |
Build environment |
Node v17+ (recommended) |
Compilation tool |
Webpack 5 + Babel 7 is recommended. |
Browser |
Use a supported browser by referring to Table 2. |
Due to the security policy of the browser, you can use only https://domain name to load and run the intelligent interaction web SDK.
OS |
Browser |
Browser Version |
---|---|---|
Windows |
Google Chrome |
91+ |
Microsoft Edge |
80+ |
|
Android |
Mobile Google Chrome |
91+ |
iOS |
Mobile Safari |
17.3+ |
Mac |
Safari |
15.6+ |
OS |
Browser |
Browser Version |
---|---|---|
Windows |
Google Chrome |
94+ |
Microsoft Edge |
94+ |
|
Android |
Mobile Google Chrome |
94+ |
iOS |
Mobile Safari |
17.3+ |
macOS |
Safari |
16.4+ |
Quick SDK Integration
- Place the downloaded SDK package in the sdk directory of your project.
- Import HwICSUiSdk to the project code.
- To import the SDK using <script>, access HwICSUiSdk to obtain the exported module:
<script src='./sdk/HwICSUiSdk.js'></script>
- To directly reference the static JS file of Huawei WebRTC SDK, use the following:
import { HwICSUiSdk } from './sdk/HwICSUiSdk'
- In addition to the preceding JS file, you also need to import the CSS file. You can import the CSS file using the link tag, or directly import it in the project.
<link rel="stylesheet" href="./sdk/HwICSUiSdk.css"> import './sdk/HwICSUiSdk.css' @import './sdk/HwICSUiSdk.css'
- To import the SDK using <script>, access HwICSUiSdk to obtain the exported module:
- Check whether the browser supports the SDK. For details about the APIs, see checkBrowserSupport.
1 2 3 4 5 6
const result = await HwICSUiSdk.checkBrowserSupport(); if (result) { // Supported } else { // Not supported }
- Add a container element to the page for intelligent interaction tasks.
The container element must contain the id attribute.
1
<div id="ics-sdk" style="width: 100vw;height: 100vh"></div>
- Create an intelligent interaction task. For details about the APIs, see create.
1 2 3 4 5 6
HwICSUiSdk.create({ serverAddress: 'metastudio-api.cn-north-4.myhuaweicloud.com', onceCode: 'aaa', robotId: 'aaa', containerId: 'ics-sdk', });
Feedback
Was this page helpful?
Provide feedbackThank you very much for your feedback. We will continue working to improve the documentation.See the reply and handling status in My Cloud VOC.
For any further questions, feel free to contact us through the chatbot.
Chatbot