thingsboard_client 1.1.1 copy "thingsboard_client: ^1.1.1" to clipboard
thingsboard_client: ^1.1.1 copied to clipboard

Dart implementation of ThingsBoard API client. Provides model objects and services to communicate with ThingsBoard platform using RESTful APIs and WebSocket protocol.

example/thingsboard_client.dart

import 'package:thingsboard_client/thingsboard_client.dart';

const thingsBoardApiEndpoint = 'http://localhost:8080';

void main() async {
  try {
    var tbClient = ThingsboardClient(thingsBoardApiEndpoint);
    await tbClient.login(LoginRequest('tenant@thingsboard.org', 'tenant'));

    print('isAuthenticated=${tbClient.isAuthenticated()}');

    print('authUser: ${tbClient.getAuthUser()}');

    var currentUserDetails = await tbClient.getUserService().getUser();
    print('currentUserDetails: $currentUserDetails');

    await tbClient.logout();
  } catch (e, s) {
    print('Error: $e');
    print('Stack: $s');
  }
}
14
likes
120
pub points
89%
popularity

Publisher

verified publisherthingsboard.io

Dart implementation of ThingsBoard API client. Provides model objects and services to communicate with ThingsBoard platform using RESTful APIs and WebSocket protocol.

Homepage
Repository (GitHub)
View/report issues

Documentation

API reference

License

BSD-3-Clause (LICENSE)

Dependencies

collection, dio, jwt_decoder, web_socket_channel

More

Packages that depend on thingsboard_client