SDK install
SDK
- white-web-sdk
- Recommended for non-React framework development
- white-react-sdk
- React framework development (depending on white-web-sdk, no need to repeat installation)
white-web-sdk
is the same as white-react-sdk
version, and it is published at the same time every time.
How to install
1. Package management tool integration
Add dependency:
# yarn
yarn add white-web-sdk
# npm
npm install white-web-sdk --save
Code:
import "white-web-sdk/style/index.css";
import {WhiteWebSdk} from 'white-web-sdk';
Add dependency:
# yarn
yarn add white-react-sdk
# npm
npm install white-react-sdk --save
Code:
import * as React from "react";
import "white-web-sdk/style/index.css";
import {Room, RoomPhase, RoomWhiteboard, WhiteWebSdk} from "white-react-sdk";
2. script tag integration
<link rel="stylesheet" href="https://sdk.herewhite.com/white-web-sdk/2.7.1.css">
<script src="https://sdk.herewhite.com/white-web-sdk/2.7.1.js"></script>
<script>
//Global variables WhiteWebSdk
let sdk = new WhiteWebSdk();
</script>
TypeScript support
When using TypeScript
, add the following configuration to the project tsconfig.json
to get syntax tips.
{
"compilerOptions": {
"skipLibCheck": true,
"paths": {
"*" : ["node_modules/white-web-sdk/types/*"]
}
}
}