Search packages, repositories and app categories

Package detailsv5.4.4

google_api_headers

A Flutter plugin for getting the headers required to call Google APIs with an app restricted API key

Android
30-day downloads
72.2K
Likes
31
Pub points
160

Install package

flutter pub add google_api_headers

Package Overview

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

A Flutter plugin that simplifies the process of obtaining necessary HTTP headers for authenticating requests to Google APIs when using an app-restricted API key. It ensures secure and compliant access by automatically generating required headers such as 'X-Goog-Api-Key' and 'X-Goog-AuthUser'. Designed specifically for Android, it helps developers avoid common authentication pitfalls while integrating with Google's backend services.

Use cases

  • Integrating with Google Maps API
  • Calling Google Cloud services
  • Securing API requests with app-restricted keys
  • Implementing serverless Google API calls
  • Enforcing API key restrictions in production

Key features

  • Automatically generates required headers
  • Supports app-restricted API keys
  • Android-only platform compatibility
  • Simplifies authentication setup
  • Minimal boilerplate code

Suitable for

  • Android-focused Flutter apps
  • Developers using app-restricted Google API keys
  • Projects requiring secure Google API access
  • Teams avoiding manual header management
  • Apps deploying on restricted API key environments

Considerations

  • Limited to Android platform
  • Requires proper API key configuration
  • Does not handle OAuth2 or user authentication
  • No support for iOS or web platforms
  • Depends on correct Google API key setup in project

Original README

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

Google API Headers

pub package docs MIT License GitHub Actions codecov Codacy Badge style: flutter_lints

Github-sponsors BuyMeACoffee Ko-Fi LiberaPay Patreon PayPal

A Flutter plugin for getting the headers required to call Google APIs with an app restricted API key.

Getting Started

Add this to your project's pubspec.yaml file:

dependencies:
  google_api_headers: ^5.4.1

Usage

Depending on the platform (iOS or Android), the function will return the required key and value pairs for calling Google APIs with keys that are restricted to an iOS or Android app.

import 'package:google_api_headers/google_api_headers.dart';

final headers = await GoogleApiHeaders().getHeaders();

Categories

Dependencies

Dependency list 1 items

Source repository

Projects using this package