diff --git a/AUTHORS b/AUTHORS index b1c29787ce18..7ced0a7e90fc 100644 --- a/AUTHORS +++ b/AUTHORS @@ -66,3 +66,4 @@ Horváth István Liu Zhisong Ievgenii Kovtun Dinu-Stefan Rusu +Vansh Vashisht diff --git a/packages/firebase_ai/firebase_ai/README.md b/packages/firebase_ai/firebase_ai/README.md index 782c992a9cbe..98b87616b96f 100644 --- a/packages/firebase_ai/firebase_ai/README.md +++ b/packages/firebase_ai/firebase_ai/README.md @@ -15,6 +15,31 @@ To get started with Firebase AI Logic Flutter, please [see the documentation](ht To start use this plugin, please visit the [Text only prompt documentation](https://firebase.google.com/docs/ai-logic/generate-text?platform=flutter) +## App Check Integration + +If your app uses [Firebase App Check](https://firebase.google.com/docs/app-check), you can pass +the `AppCheck` instance directly to `FirebaseAI` to protect your Gemini API calls from unauthorized clients. + +Add `firebase_app_check` to your `pubspec.yaml`: + +```yaml +dependencies: + firebase_app_check: latest_version +``` + +Then initialize `FirebaseAI` with App Check: + +```dart +import 'package:firebase_ai/firebase_ai.dart'; +import 'package:firebase_app_check/firebase_app_check.dart'; + +final model = FirebaseAI.instanceFor( + appCheck: FirebaseAppCheck.instance, +).generativeModel(model: 'gemini-2.0-flash'); +``` + +For more details, see the [App Check documentation](https://firebase.google.com/docs/app-check). + ## Issues and feedback Please file FlutterFire specific issues, bugs, or feature requests in our [issue tracker](https://github.com/firebase/flutterfire/issues/new). @@ -23,4 +48,4 @@ Plugin issues that are not specific to FlutterFire can be filed in the [Flutter To contribute a change to this plugin, please review our [contribution guide](https://github.com/firebase/flutterfire/blob/main/CONTRIBUTING.md) -and open a [pull request](https://github.com/firebase/flutterfire/pulls). +and open a [pull request](https://github.com/firebase/flutterfire/pulls). \ No newline at end of file