OTP_AUTO_READ
const callback = (eventCallback) => { console.log({ eventCallback }); const OTP_AUTO_READ = () => { const { response: { otp } } = eventCallback; // Auto-read OTP value //console.log(otp); } const EVENTS_MAP = { OTP_AUTO_READ } if ("responseType" in eventCallback) EVENTS_MAP[eventCallback.responseType]() }