import { Server } from "@hocuspocus/server"; const server = Server.configure({ async onAuthenticate(data) { const { token } = data; if (token !== "hocuspocus-token") { throw new Error("Not authorized!"); } }, port: 4242, }); server.listen();