0.5.0 • Published 2 months ago

demoway-sdk v0.5.0

Weekly downloads
-
License
-
Repository
-
Last release
2 months ago

Demoway SDK

Install

pnpm

pnpm add demoway-sdk

npm

npm install demoway-sdk --save

yarn

yarn add demoway-sdk

Initialize DemoWay SDK

Initialize DemoWay SDK before application rendering

Vue Example

import { initialize, IUserInfo } from 'demoway-sdk';
import { createApp } from 'vue';

initialize({
  accessToken: '', 
  appId: '',
  userInfo: {
    openId: '',
    userName: '',
    nickName: ''
    xxx: '',
    company: { 
      id: ''  
      name: '' 
    }
  } as IUserInfo, // IUserInfo is TS interface, you can remove it if you are not using TS
})
/**
* render your app
*/
createApp(App).mount();

React Example

import { initialize, IUserInfo } from 'demoway-sdk';
import { createRoot } from 'react-dom/client';

initialize({
  accessToken: '', 
  appId: '',
  userInfo: {
    openId: '',
    userName: '',
    nickName: ''
    xxx: '',
    company: { 
      id: ''  
      name: '' 
    }
  } as IUserInfo, // IUserInfo is TS interface, you can remove it if you are not using TS
})

/**
* render your app
*/
const domNode = document.getElementById('root');
const root = createRoot(domNode);
root.render(<App />);
NameRequiredDescription
accessTokenrequiredtemporary access token fot test, you can get it from your DemoWay dashboard
appIdrequiredyour DemoWay application id, you can get it from your DemoWay dashboard
userInfooptionalstrongly recommend
userInfo.openIdoptionalopen user id of the user in your system, you can associate each user with the users in your own system when retrieving user access records through the API. strongly recommend
userInfo.nickNameoptionalthe nick name of the user in your system
userInfo.xxxoptionalyou can add string value with any key name to "userInfo"
userInfo.companyoptionalstrongly recommend
userInfo.company.idoptionalthe company id of the user in your system
userInfo.company.namerequiredthe company or organization name of the user, required in userInfo.company

When a user accesses the demo, Demoway will create an anonymous user for them. If you provide the "userInfo" field when initializing the SDK, this information will be associated with the anonymous user. In the Demoway dashboard, when viewing the user's access records, you may also see this information. This makes it convenient to identify different users. If the "userInfo" includes the "openId" field, you can associate each user with the users in your own system when retrieving access records through the API.

Usage

Open Demo in Dialog

Open a demo in dialog, which can switch to full screen mode.

import { openDemoDialog } from 'demoway-sdk';

openDemoDialog('demo-id'); // demo-id can be got from DemoWay dashboard

Open CheckList in Dialog

Open a checklist in dialog, which can switch to full screen mode.

import { openDemoDialog } from 'demoway-sdk';

openDemoDialog('demo-id', {checklistId: 'checklist-id'}); // demo-id and checklist-id can be got from DemoWay dashboard

Record a New Demo

Enable recording feature and show recording board by calling enableRecord function.

import { enableRecord } from 'demoway-sdk';

// enable recording feature and show recording board
enableRecord();

Enable recording feature and show recording board by rage click.

import { enableRecord, rageClick } from 'demoway-sdk';

const button = document.querySelector('button');

// rage click button 5 times with 1000ms interval
rageClick(button, 5, 1000).then(() => {
  // enable recording feature and show recording board
  return enableRecord();
});
0.5.0

2 months ago

0.4.8

7 months ago

0.4.3-beta.1

8 months ago

0.4.3-beta.0

8 months ago

0.4.3-beta.3

8 months ago

0.4.3-beta.2

8 months ago

0.2.0-beta.2

9 months ago

0.2.0-beta.1

9 months ago

0.2.0-beta.0

9 months ago

0.2.0-beta.3

9 months ago

0.3.0

9 months ago

0.2.1

9 months ago

0.2.0

9 months ago

0.4.5

8 months ago

0.4.4

8 months ago

0.4.7

7 months ago

0.4.6

7 months ago

0.4.1

9 months ago

0.4.0

9 months ago

0.3.1

9 months ago

0.2.2

9 months ago

0.4.3

8 months ago

0.4.2

8 months ago

0.1.1

11 months ago

0.1.0

11 months ago

0.0.2

11 months ago

0.0.1

11 months ago