ground_control_client 0.17.0 copy "ground_control_client: ^0.17.0" to clipboard
ground_control_client: ^0.17.0 copied to clipboard

A client library for the Serverpod Ground Control API. Used to manage Serverpod Cloud projects.

example/main.dart

import 'package:ground_control_client/ground_control_client.dart';

// This is the URL to the server and should be replaced with the actual URL to
// the server.
var url = 'http://localhost:8080/';

Future<void> main() async {
  var client = Client(
    url,
  )..authKeyProvider = _SimpleAuthenticationKeyManager('mock-token');

  client.close();
}

// Simple implementation for managing authentication keys.
class _SimpleAuthenticationKeyManager implements ClientAuthKeyProvider {
  String? _key;

  _SimpleAuthenticationKeyManager(this._key);

  @override
  Future<String?> get authHeaderValue async {
    return switch (_key) {
      final String key => wrapAsBearerAuthHeaderValue(key),
      null => null,
    };
  }
}
2
likes
150
points
652
downloads

Publisher

verified publisherserverpod.dev

Weekly Downloads

A client library for the Serverpod Ground Control API. Used to manage Serverpod Cloud projects.

Homepage
Repository (GitHub)
View/report issues

Topics

#api #client

Documentation

API reference

License

BSD-3-Clause (license)

Dependencies

dio, http, mocktail, serverpod_auth_bridge_client, serverpod_auth_client, serverpod_auth_idp_client, serverpod_auth_migration_client, serverpod_client

More

Packages that depend on ground_control_client