This is a middy middleware, which is parsing AWS API Gateway events according to the JSON:API spec.
npm install @joblocal/middy-json-api-parser
# handler.js
const middy = require('middy');
const jsonApiParser = require('@joblocal/middy-json-api-parser');
const yourHandler = (event) => {
console.log(event.data);
};
const handler = middy(yourHandler)
.use(jsonApiParser());
module.exports = { handler };