import { authorize } from "@liveblocks/node" ; import { NextApiRequest , NextApiResponse } from "next" ; const API_KEY = process . env . LIVEBLOCKS_SECRET_KEY ; export default async function auth ( req , res ) { if ( ! API_KEY ) { return res . status ( 403 ) . end ( ) ; } const room = req . body . room ; const response = await authorize ( { room , secret : API_KEY , } ) ; return res . status ( response . status ) . end ( response . body ) ; }