Search packages, repositories and app categories

Package detailsv0.2.0

firebaseapis

Auto-generated client libraries for accessing Google APIs described through the API discovery service.

AndroidiOSWebmacOSWindowsLinux
30-day downloads
20.5K
Likes
21
Pub points
160

Install package

flutter pub add firebaseapis

Package Overview

Package selection guidance compiled from public package information, community data, and project usage.

The firebaseapis package provides auto-generated client libraries for accessing Google APIs via the API discovery service. Built for Flutter and Dart, it enables seamless integration with Firebase and other Google services by generating type-safe APIs from official API descriptions. This allows developers to interact with Google's vast ecosystem—such as Drive, Calendar, and Cloud Storage—directly from their apps across Android, iOS, Web, macOS, Windows, and Linux platforms. The package is maintained by invertase.io and supports modern Flutter development workflows.

Use cases

  • Integrating with Google Drive
  • Accessing Google Calendar data
  • Fetching user information from Google Identity
  • Managing Cloud Storage operations
  • Synchronizing data with Google Sheets
  • Connecting to YouTube Data API

Key features

  • Auto-generated from official API discovery documents
  • Type-safe Dart interfaces
  • Cross-platform support (Android, iOS, Web, macOS, Windows, Linux)
  • Seamless integration with Firebase projects
  • Supports OAuth2 authentication flows
  • Regular updates with new Google API releases

Suitable for

  • Developers building apps that need Google API access
  • Projects requiring integration with multiple Google services
  • Cross-platform applications targeting all major OSes
  • Teams using Firebase as backend infrastructure
  • Apps needing secure, authenticated API calls to Google services

Considerations

  • Requires understanding of Google API discovery format
  • Authentication setup (OAuth2) can be complex
  • Large generated codebase may increase build size
  • Limited documentation beyond generated API reference
  • Not ideal for simple use cases where lightweight clients suffice

Original README

Original README snapshot from the linked source repository. Visit the repository for the latest content.

Firebase API Client Libraries for Dart

Chat on Discord

melos

This is based on the googleapis.dart repository but instead aimed at supporting Firebase related APIs only. Additionally, this adds support for several unlisted (but discoverable) Firebase APIs that are not listed on the official discovery API that googleapis.dart uses (and is currently limited to) as well as several private APIs (APIs that require an API key to view discovery information).

See ./generated/firebaseapis/README.md for information on all the currently supported APIs.

Usage Example

// Import the APIs you want to use
import 'package:firebaseapis/firebaseremoteconfig/v1.dart' as remote_config;
import 'package:firebaseapis/firebaserules/v1.dart' as firebase_rules;
// Import Auth client
import 'package:googleapis_auth/auth_io.dart' as auth;

// Get an Auth Client
final authClient = await auth.clientViaApplicationDefaultCredentials(scopes: [
  remote_config.FirebaseRemoteConfigApi.cloudPlatformScope,
]);

// Call some APIs
final rc = remote_config.FirebaseRemoteConfigApi(authClient);
final config =
  await rc.projects.getRemoteConfig('projects/<your-project-id>');
print(config.parameters);
print(config.parameters?.values.first.defaultValue);
print(config.parameters?.values.first.description);
print(config.parameters?.values.first.valueType);

final fr = firebase_rules.FirebaseRulesApi(authClient);
final rules =
  await fr.projects.rulesets.list('projects/<your-project-id>');
print(rules.rulesets?.first.name);
print(rules.rulesets?.first.source?.files?.first.content);

Custom Request Headers

Custom request headers can be set by adding to requestHeaders:

import 'package:firebaseapis/src/user_agent.dart';

Future<void> main() async {
  requestHeaders.addAll({
    'cool-header': 'cool-value',
  });
  print(requestHeaders);
}

Contributing

This project uses Melos to manage the project and dependencies.

To install Melos, run the following command from your SSH client:

dart pub global activate melos

Next, at the root of your locally cloned repository bootstrap the projects dependencies:

melos bootstrap

The bootstrap command locally links all dependencies within the project without having to provide manual dependency_overrides. This allows all plugins, examples and tests to build from the local clone project.

You do not need to run flutter pub get once bootstrap has been completed.

Adding a new API

To add a new API and generate library code for it is fairly straightforward;

  1. Add the API to the apis list in ./config.yaml
  2. Run melos run config:download to update the downloaded discovery document JSON files that are in ./discovery.
    • Note: several APIs require an API key to be able to read the discovery information. Set a API_KEY environment variable before running the command to be able to download the discovery documents for these private APIs, e.g. API_KEY=<your-key-here> melos run config:download.
  3. Run melos run config:generate to generate new Dart library code for the API, which outputs to ./generated/firebaseapis.

Maintained by Invertase.

Categories

Dependencies

Dependency list 2 items

  • _discoveryapis_commons^1.0.0
  • http>=0.13.0 <2.0.0

Source repository

Projects using this package