The Configuration object should take a clientId and an apiKey instead of a username and password:
// This:
const apiConfig = new Configuration({
clientId: process.env.MX_CLIENT_ID,
apiKey: process.env.MX_API_KEY,
})
// Instead of this:
const apiConfig = new Configuration({
username: process.env.MX_CLIENT_ID,
password: process.env.MX_API_KEY,
})