Revali Client

Runtime library for clients generated by revali_client_gen: RevaliClient, HttpInterceptor, RetryPolicy, Storage, ServerException, and the @ExcludeFromClient annotation.

Installation

In the Revali server project:

dart pub add revali_client
dart pub add --dev revali_client_gen

Run dart run revali dev to generate the client package into .revali/revali_client/. The app that calls the API depends on that package (by path) and on revali_client.

Usage

import 'package:client/client.dart'; // the generated package, `package_name` in revali.yaml

Future<void> main() async {
  final server = Server(baseUrl: Uri.parse('https://api.example.com/api'));

  final user = await server.user.getById(id: '123');
}

Documentation

docs.revali.dev/constructs/revali_client

Libraries

revali_client