npm i @woflowinc/link
Make sure you have your JWT token and public key
Use the following code to embed your Portal into your app:
import { WoflowLink } from "@woflowinc/link";
const options = {
jwt: token,
publicKey: publicKey,
linkConfigurationId: linkConfigurationId,
theme: {
width: 600 // 400 (default), 600, 800
}
}
// To initialize pass JWT token and public key - authenticate platform
const woflow = new WoflowLink(options);
// use this wherever you need to trigger an import
woflow.openIframe({
onData: (data) => {
console.log(`Data returned from Woflow`)
console.log({data})
},
onClose: () => {
console.log("Woflow SDK has been closed")
}
})