vrchat_dart 0.5.3 copy "vrchat_dart: ^0.5.3" to clipboard
vrchat_dart: ^0.5.3 copied to clipboard

outdated

This is a Dart client that interacts with the unofficial VRChat API

example/main.dart

import 'package:vrchat_dart/vrchat_dart.dart';

void main() async {
  final api = VrchatDart().api;

  final loginResponse = await api.auth.login();

  if (loginResponse.error != null) {
    print('authError');
    print(loginResponse.error);
  } else if (loginResponse.requiresTwoFactorAuth) {
    print('requiresTwoFactorAuth');
    final twoFactorResponse = await api.auth.verify2fa('123456');
    if (twoFactorResponse.error == null) {
      print('2fa verification success');
    } else {
      print('2fa verification failure');
      print(twoFactorResponse.error);
    }
  } else {
    print('Logged in');
    print(api.auth.currentUser?.username);
  }
}