This is a simple Express-based backend service that generates LiveKit access tokens for participants and notifies a bot service when a participant joins a room.
- Generates JWT tokens for LiveKit participants.
- Notifies a bot service to join the room when a participant joins.
- Implements CORS to allow cross-origin requests.
Make sure you have the following installed:
- Node.js (v14 or later)
- npm or yarn
-
Clone the repository:
git clone <repository-url> cd <repository-folder>
-
Install dependencies:
npm install
Create a .env file in the project root and add the following variables:
LIVEKIT_API=<your_livekit_api_key>
LIVEKIT_SECRET=<your_livekit_secret_key>
BOT_SERVICE_URL=<your_bot_service_url>Start the server:
node server.jsThe server will run on http://localhost:3001 by default.
GET /getToken?participantName=<name>&roomName=<room>
- Parameters:
participantName: The name of the participant.roomName: The name of the LiveKit room.
- Response:
{ "success": true, "token": "<jwt_token>" }