Strapi-plugin-io running problems


Hey, there.
I tried running strapi-plugin-io
after installation, I created the .config/plugins.js file.

module.exports = ({ env }) => ({

  io: {
    enabled: true,
    config: {
      // the article content type will only emit create actions
      contentTypes: ["api::event.event"],
    },
    events: [
      {
        name: "connection",
        handler: ({ strapi }, socket) => {
          // will log every time a client connects
          strapi.log.info(
            `[io] a new client with id ${socket.id} has connected`
          );
        },
      },
    ],
  },
});

Having created a file with this code I ran strapi and got the following error in the console

Error: Error regarding io config: [
{
“code”: “invalid_type”,
“expected”: “array”,
“received”: “object”,
“path”: [
“events”
],
“message”: “Expected array, received object”
},
{
“code”: “invalid_type”,
“expected”: “array”,
“received”: “object”,
“path”: [
“contentTypes”
],
“message”: “Expected array, received object”
}
]
at applyUserConfig (D:\work\eventapp-2.0\backend\node_modules@strapi\strapi\dist\core\loaders\plugins\index.js:66:15)
at async Object.loadPlugins (D:\work\eventapp-2.0\backend\node_modules@strapi\strapi\dist\core\loaders\plugins\index.js:98:3)
at async Strapi.loadPlugins (D:\work\eventapp-2.0\backend\node_modules@strapi\strapi\dist\Strapi.js:304:5)
at async Promise.all (index 3)
at async Strapi.register (D:\work\eventapp-2.0\backend\node_modules@strapi\strapi\dist\Strapi.js:334:5)
at async Strapi.load (D:\work\eventapp-2.0\backend\node_modules@strapi\strapi\dist\Strapi.js:418:5)
at async workerProcess (D:\work\eventapp-2.0\backend\node_modules@strapi\strapi\dist\commands\actions\develop\action.js:110:26)
at async action (D:\work\eventapp-2.0\backend\node_modules@strapi\strapi\dist\commands\actions\develop\action.js:38:14)

Thanks in advance for the help.

Hey!
The events array should be inside config object. Try to copy past the example here: Events | Strapi Plugin IO (strapi-plugin-io.netlify.app)