turnix_dart 0.1.5 copy "turnix_dart: ^0.1.5" to clipboard
turnix_dart: ^0.1.5 copied to clipboard

A Dart SDK for fetching WebRTC ICE (STUN/TURN) credentials from the Turnix.io API, with support for advanced options like regions, TTL, client IP, and per-call parameters.

example/turnix_dart_example.dart

import 'package:turnix_dart/turnix_dart.dart';

void main() async {
  const apiToken = 'your-api-token-here'; // <- get on turnix.io

  try {
    final creds = await TurnixIO.getIceCredentials(
      apiToken: apiToken,
      initiatorClient: 'alice',
      receiverClient: 'bob',
      room: 'demo-room',
      ttl: 120, // optional
    );

    print('ICE credentials fetched successfully!');
    for (final server in creds.iceServers) {
      print('Server: ${server.urls.join(", ")}');
      if (server.username != null) {
        print('Username: ${server.username}');
        print('Credential: ${server.credential}');
      }
    }
    print('Expires at: ${creds.expiresAt.toIso8601String()}');
  } catch (e) {
    print('Error fetching ICE credentials: $e');
  }
}
6
likes
0
points
23
downloads

Publisher

unverified uploader

Weekly Downloads

A Dart SDK for fetching WebRTC ICE (STUN/TURN) credentials from the Turnix.io API, with support for advanced options like regions, TTL, client IP, and per-call parameters.

Homepage
Repository (GitHub)
View/report issues

License

unknown (license)

Dependencies

http

More

Packages that depend on turnix_dart