bytefun-js
Version:
ByteFun JavaScript SDK
57 lines (43 loc) • 1.21 kB
Markdown
> ByteFun快速开发平台,web端的SDK
登录 [ByteFun官网](https://www.bytefungo.com/) 查看更多信息
使用 npm:
```sh
npm install bytefun-js
```
使用 yarn:
```sh
yarn add bytefun-js
```
APP_ID 和 APP_KEY 请登录 [ByteFun官网](https://www.bytefungo.com/) 获取。
AppConfig.js
```js
export default class AppConfig {
public static readonly APP_ID = '你的appId'
public static readonly APP_KEY = '你的appKey'
}
```
在项目中引入 SDK 并初始化,示例如下:
```js
import { ByteFunSDK,Platform } from 'bytefun-js';
ByteFunSDK.init({
el: '#app', // 挂载的根节点
serverLib: new ByteFunServer(),
appId: AppConfig.APP_ID,
appKey: AppConfig.APP_KEY,
platform: Platform.H5,
debug: true, // 是否开启测试调试模式, 默认为false,正式发布之后需要去掉
})
```
ByteFunServer 接口实现:
```js
import { IServerLib } from 'bytefun-js';
export class ByteFunServer implements IServerLib {
...
}
```
ByteFunServer 接口实现具体逻辑,具体请参考 [ByteFun 官网文档](https://www.bytefungo.com) 对应的DEMO工程
更多信息请访问
[](https://www.bytefungo.com)