revali_client 3.1.0
revali_client: ^3.1.0 copied to clipboard
A Revali Server Client Construct to generate client code using `revali_router`
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');
}