Skip to main content
The Dart SDK is published to pub.dev as teambattles_sdk. It is generated from the OpenAPI spec with Microsoft Kiota and regenerates on every API change.
Dart is a preview SDK - its Kiota runtime dependencies are still pre-release. See SDKs overview for maturity details.

Install

dart pub add teambattles_sdk

Authenticated first call

import 'dart:io';
import 'package:teambattles_sdk/teambattles_sdk.dart';

final client = createTeamBattlesClient(
  Platform.environment['TEAMBATTLES_API_KEY']!,
);

// List the authenticated user's matches (requires matches.user_matches: read)
final body = MatchesRequestBody()..numItems = 25;
final result = await client.user.matches.post(body);
for (final match in result?.page ?? []) {
  print('${match.id} ${match.status}');
}

Authentication

The factory wires an Authorization: Bearer tb_<your-key> header on every request. Create keys at Settings > Developer and review scopes in the authentication guide. Treat the error machine code in error responses - not the details message - as the stable programmatic contract.