0.0.4 • Published 4 months ago
aai-osp-websdk v0.0.4
aai osp SDK
The official Javascript client library for the AAI one-stop flow.
Table of Contents
Install
NPM
npm install aai-osp-websdk
CDN
<!-- Replace "<version>" with the actual SDK version you want to use, example: v0.0.4 -->
<script src="https://cdn-sg-sandbox-osp.advai.net/resource/osp-web-sdk/0.0.4/aai-osp-websdk.js" charset="utf-8"></script>
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',
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!')
}
})