import { authenticateTotpMfaDevice } from '@dynamic-labs-sdk/client';
const onLogin = async () => {
// Replace '123456' with the actual TOTP code the user enters
await authenticateTotpMfaDevice({ code: '123456' });
};
// if you are using action-based MFA, you can create a single use MFA token for the action
// that mfa token will be stored in the user's session and will be used to authorize the action
const onExportPrivateKeyClick = async () => {
// Replace '123456' with the actual TOTP code the user enters
await authenticateTotpMfaDevice({
code: '123456',
createMfaTokenOptions: { singleUse: true },
});
// then you can perform the action
await exportWaasPrivateKey(params);
};