fresh_grpc 1.0.0 fresh_grpc: ^1.0.0 copied to clipboard
An grpc link for token refresh. Built on top of package:grpc and manages authentication tokens transparently.
fresh_grpc 🍋 #
A grpc authenticator for built-in token refresh. Built to be used with fresh.
Usage #
import 'package:fresh_grpc/fresh_grpc.dart';
main() async {
final channel = ClientChannel(
'localhost',
port: 50051,
options: ChannelOptions(
credentials: ChannelCredentials.insecure(),
codecRegistry:
CodecRegistry(codecs: const [GzipCodec(), IdentityCodec()]),
),
);
final fresh = FreshGrpc.oAuth2();
final stub = GreeterClient(channel,options:fresh.toCallOptions());
await fresh.retryUnary(stub.sayHello, HelloRequest()..name = 'world');
}
Features and bugs #
Please file feature requests and bugs at the issue tracker.