feat: enhance collaboration session and LiveKit integration
- Added LiveKitRoomService to manage meeting room creation and recording functionalities. - Updated CollaborationSessionSchema to create a LiveKit room upon new collaboration session creation. - Introduced meetingRoomJoinInfo field in MeetingRoomSchema to provide join tokens and server URLs for meeting rooms. - Improved LiveKitService to include user metadata in token generation and added a method to retrieve the server URL. - Enhanced error handling and authorization checks across schemas to ensure proper access control for collaboration sessions and meeting rooms.
This commit is contained in:
@@ -15,7 +15,9 @@ export class LiveKitService {
|
||||
throw new Error('User must have a name')
|
||||
}
|
||||
const token = new AccessToken(process.env.LIVEKIT_API_KEY as string, process.env.LIVEKIT_API_SECRET as string, {
|
||||
identity: me.name,
|
||||
identity: me.id,
|
||||
name: me.name,
|
||||
metadata: me.avatarUrl ?? '',
|
||||
})
|
||||
token.addGrant({
|
||||
roomJoin: true,
|
||||
@@ -23,4 +25,8 @@ export class LiveKitService {
|
||||
})
|
||||
return await token.toJwt()
|
||||
}
|
||||
|
||||
getServerUrl() {
|
||||
return process.env.LIVEKIT_URL
|
||||
}
|
||||
}
|
||||
|
||||
Reference in New Issue
Block a user