Skip to content

Make FirebaseApp.client fully public #208

@jellynoone

Description

@jellynoone

Is your feature request related to a problem? Please describe.
Currently, I'm tinkering with firebase_functions.
These use FirebaseApp from dart_firebase_admin and expose the app to the consumer.

The FirebaseApp itself provides core firebase services which use the package:googleapis_auth AuthClient.

However, some of these services (e.g. storage) have a trimmed down API, which isn't sufficient for all use cases.

For instance, my current requirement is being able to upload a large file to Cloud Storage (several GBs) and fetch the file in ranges.
The API provided by default only supports direct data uploads and full data downloads, which isn't feasible for large files.

Whereas the googleapis package provides a more complete API, which supports streaming uploads.

Thus, it would be great if the AuthClient was exposed as part of the actual public API, so consumers can use it
without having to re-implement the same initialization logic FirebaseApp does under the hood, and so we don't have
to have separate clients for interacting with the same services.

Describe the solution you'd like
Remove the @internal annotation and make AuthClient get client part of the public API.

/// Returns the HTTP client for this app.
/// Lazily initializes on first access.
@internal
Future<googleapis_auth.AuthClient> get client {
return _httpClient ??= options.httpClient != null
? Future.value(options.httpClient!)
: _createDefaultClient();
}

Describe alternatives you've considered
Silence the warning and use the internal API.

Metadata

Metadata

Assignees

No one assigned

    Labels

    enhancementNew feature or request

    Type

    No type

    Projects

    No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions