import * as QuadrataTypes from '@quadrata/sdk/types';
import { Quadrata } from '@quadrata/sdk/client';
const quadrataSdkConfig: QuadrataTypes.QuadrataSdkConfiguration = {
environment: QuadrataTypes.QuadrataEnvironment.SANDBOX
};
export default function KybOnboardingComponent(props: { accessToken: string }) {
const quadrataProps = {
accessToken: props.accessToken,
sdkConfig: quadrataSdkConfig,
clientConfig: {
_debug: true,
protocolName: 'Your Company Name'
},
kybProps: {
// see available props at
// https://docs.quadrata.com/integration/how-to-integrate/onboard-users/business-passport-onboarding/3.-quadratakyb-package
onApplicationEnd: (data: Record<string, any>) => {
console.log('Application ended', data.status, data.error);
},
},
};
return (
<Quadrata {...quadrataProps}>
{((helper: QuadrataTypes.Client.Components.Helper) => {
if (helper.isApplicationComplete) {
return <p>Application is Complete</p>;
}
if (helper.isPassportInReview) {
return <p>Your application is in review.</p>;
}
return (
<button
disabled={!helper.isApplicationReady}
onClick={helper.launchApplication}
>
Launch Application
</button>
);
})}
</Quadrata>
);
}