fire_api_dart 1.1.6 fire_api_dart: ^1.1.6 copied to clipboard
An implementation for fire_api for dart servers using googleapis.
This is a dart implementation for fire_api
Usage #
To use Firestore, you need to either make sure you are running in a google cloud environment or provide a service account key file.
If you are not running on google and want to easily test ensure the following environment variables are set when running. (in intellij, you can set them in the run configuration)
- GCP_PROJECT=<project_id>
- GOOGLE_APPLICATION_CREDENTIALS=<path_to_service_account_key.json>
If you need a custom database name, other than "(default)", or a custom AuthClient you can use the GoogleCloudFirestoreDatabase.create(database: "mydbname", auth: AuthClient)
to override.
import 'package:fire_api_dart/fire_api_dart.dart';
void main() async {
// You need to await this because using auth credentials requires async
await GoogleCloudFirestoreDatabase.create();
}