esp_rainmaker 1.0.0+2 copy "esp_rainmaker: ^1.0.0+2" to clipboard
esp_rainmaker: ^1.0.0+2 copied to clipboard

A wrapper of the ESP Rainmaker REST API for client-cloud communication.

example/esp_rainmaker_example.dart

import 'package:esp_rainmaker/esp_rainmaker.dart';

Future<void> main() async {
  final user = User();

  //Create new user
  await user.createUser('email@email.com', 'Password12345');

  //Login and extend session
  final login = await user.login('email@email.com', 'Password12345');
  await user.extendSession('email@email.com', login.refreshToken);

  //Add node mapping and check status
  final nodeAssociation = NodeAssociation(login.accessToken);
  final reqId = await nodeAssociation.addNodeMapping('nodeid1234', 'very_secret_key');
  print(await nodeAssociation.getMappingStatus(reqId));
}
5
likes
130
pub points
0%
popularity

Publisher

unverified uploader

A wrapper of the ESP Rainmaker REST API for client-cloud communication.

Repository (GitHub)
View/report issues

Documentation

API reference

License

GPL-3.0 (license)

Dependencies

http, isolate_json, meta

More

Packages that depend on esp_rainmaker