fetch is not defined amazon-cognito-identity-js

JavaScript
global.fetch = require('node-fetch')

Source

Also in JavaScript: