aai-osp-websdk
v0.0.8
Published
The official Javascript client library for the AAI one-stop flow.
Downloads
178
Readme
aai osp SDK
The official Javascript client library for the AAI one-stop flow.
Table of Contents
Install
npm install aai-osp-websdk
Documentation
The module provides a sdk for the AAI OSP flow. For complete information about the API, head to the docs.
Getting Started
To open the flow you must create a osp
object.
import OSP from 'aai-osp-websdk'
const container = document.querySelector('#app')
const osp = OSP.init(container!, {
token: 'XXXXX-XXXX-XXXX-XXXX-XXXXXXXXXX', // Obtain the token according to the integration doc
environment: 'sandbox',
language: 'en',
captureConfig: {
type: !!window.MediaRecorder ? 'video' : 'image',
videoConfig: {
videoBitsPerSecond: 200000,
},
imageConfig: {
mimeType: 'image/jpeg',
quality: 0.4,
loopTime: 1000
}
},
onReady() {
console.log('onReady')
osp.open()
},
onLoad() {
console.log('onload')
},
onError() {
console.error('onerror')
},
onEvent(data) {
console.log(`onEvent:${JSON.stringify(data)}`)
},
onComplete(){
console.log('workflow complete!')
}
})