browser-sdk
npm i @aplazame/browser
import { AplazameIFrame } from '@aplazame/browser'
const apzIframe = new AplazameIFrame({
url: 'https://aplazame.com/app',
searchParams: {
publicKey: 'foobar',
},
})
apzIframe
.mount(document.querySelector('#iframe_container'))
apzIframe
.on('status', e => {
console.log('status received from iframe:')
console.log('details', e.details)
})
function onSubmit () {
apzIframe.request('submit')
}
AplazameIFrame object
constructor
const apzIframe = new AplazameIFrame({
url,
searchParams,
})
methods
apzIframe.send(event: string, payload: unknown)
apzIframe.request(request: string, payload: unknown)
apzIframe.mount(el: HTMLElement)
apzIframe.setStyles(styles: string | { [key: string]: string })
apzIframe.addStylesPreset(name: string, styles: { [key: string]: string })
apzIframe.resetStyles()
apzIframe.unmount()
default styles presets
const defaulsIframeStylesPresets: {
fill_fixed: {
position: 'fixed',
top: '0',
left: '0',
width: '100%',
height: '100%',
border: 'none',
},
fill_absolute: {
position: 'absolute',
top: '0',
left: '0',
width: '100%',
height: '100%',
border: 'none',
},
}