thingsboard_pe_client

ThingsBoard Professional Edition REST API client for Flutter.

Auto-generated from the ThingsBoard OpenAPI spec with a handwritten runtime facade providing JWT authentication, automatic token refresh, WebSocket telemetry subscriptions, and typed error handling.

Features

  • Full REST API coverage — 81 service classes, 949+ model types
  • JWT authentication — Login, auto-refresh, concurrent request handling
  • WebSocket telemetry — Real-time device data subscriptions with auto-reconnect
  • Typed errors — ThingsboardError with ThingsBoardErrorCode enum and retry logic
  • Flutter Web + Mobile — No bare dart:io imports; works on all Flutter platforms
  • Compatible with ThingsBoard 4.4.0

Installation

dependencies:
  thingsboard_pe_client: ^4.4.0

Quick Start

import 'package:thingsboard_pe_client/thingsboard_pe_client.dart'
    hide LoginRequest;
import 'package:thingsboard_pe_client/src/model/login_models.dart'
    show LoginRequest;

void main() async {
  final tbClient = ThingsboardClient('https://your-tb-instance.com');

  // Login
  await tbClient.login(LoginRequest(
    userName: 'tenant@thingsboard.org',
    password: 'tenant',
  ));
  print('Logged in: ${tbClient.isAuthenticated()}');

  // List devices
  final response = await tbClient.getDeviceControllerApi()
      .getTenantDevices(pageSize: 10, page: 0);
  print('Devices: ${response.data?.data?.length}');

  // Logout
  await tbClient.logout();
}

Documentation

License

Apache 2.0 — see LICENSE.