recently I have been implementing my Ionic App with Persona KYC. But I still have a problem with the integration. When I execute the javascript code in Ionic I get the error mentioned in the title. If someone can help me and the community to resolve this would be awesome.
Script:
function openClient(uid) {
const client = new Persona.Client({
templateId: 'itmpl_KxEjwiJXJMntb25dJXdrBnTP',
environmentId: 'env_gQDYrnzBZfXSiPWWdj4VSRGo',
referenceId: uid,
onReady: () => client.open(),
onComplete: ({ inquiryId, status, fields }) => {
console.log(`Completed inquiry ${inquiryId} with status ${status}`);
}
});
}
function cancelClient() { client.cancel(true); }
Typescript method calling the javascript function:
declare var openClient;
async openVerifyIdentityModal() {
if (!this.verifyIdentity) {
await openClient(this.auth.currentUser.uid);
await Preferences.set({ key: "verifyidentity", value: "true" });
}
}