Skip to main content

daravel_livekit 1.16.0 copy "daravel_livekit: ^1.16.0" to clipboard
daravel_livekit: ^1.16.0 copied to clipboard

LiveKit server SDK for Daravel. Access tokens with video grants, the room service (rooms, participants, data) and verified webhooks.

example/main.dart

import 'package:daravel/daravel.dart';
import 'package:daravel_livekit/daravel_livekit.dart';

/// `POST /api/rooms/{room}/join` signs a join token; LiveKit's webhooks land
/// on `POST /api/livekit/webhook`.
Application createApp() =>
    Application.configure(basePath: '.')
        .withLivekit()
        .withRouting(
          api: (router) {
            router.post('/rooms/{room}/join', (request) async {
              final room = request.param<String>('room');
              final token = await Livekit.token(
                identity: request.header('x-user') ?? 'guest',
                video: VideoGrant(roomJoin: true, room: room),
              ).toJwt();
              return {'token': token, 'url': Livekit.config.url};
            });
            router.post('/livekit/webhook', (request) async {
              final event = await Livekit.webhook(request);
              Log.info('LiveKit ${event.event}', {'room': event.room?.name});
              return Response.noContent();
            });
          },
        )
        .create();

Future<void> main() async => Application.serveWith(createApp);
0
likes
160
points
0
downloads

Documentation

Documentation
API reference

Publisher

verified publisherframework.daravel.dev

Weekly Downloads

LiveKit server SDK for Daravel. Access tokens with video grants, the room service (rooms, participants, data) and verified webhooks.

Homepage
Repository (GitHub)
View/report issues
Contributing

Topics

#livekit #webrtc #video #server #backend

Funding

Consider supporting this project:

github.com

License

MIT (license)

Dependencies

crypto, daravel

More

Packages that depend on daravel_livekit