# cloud_firestore_web 0.1.0+2

The web implementation of cloud_firestore




## Installing
```
export PUB_HOSTED_URL=https://pub.mirror.p-hatan.com
flutter pub add 'cloud_firestore_web:0.1.0+2'
```
Published: 2020-02-11T22:13:13.463181Z
Expected archive SHA-256: 053dd522d7b270db59392e829cb0e26c4b2489f43967948e9837876471b945e2

Available in cache; verification: upstream_checksum
## Direct dependencies
- cloud_firestore_platform_interface: ^1.0.0
- firebase: ^7.0.0
- firebase_core: ^0.4.3+1
- flutter: map[sdk:flutter]
- flutter_web_plugins: map[sdk:flutter]
- http_parser: ^3.1.3
- js: ^0.6.1
- meta: ^1.1.7

## Package README (untrusted upstream documentation)
# cloud_firestore_web

The web implementation of [`cloud_firestore`][1].

## Usage

### Import the package

This package is the endorsed implementation of `cloud_firestore` for the web platform since version `0.13.2`, so it gets automatically added to your application by depending on `cloud_firestore: ^0.13.2`.

No further modifications to your `pubspec.yaml` should be required in a recent enough version of Flutter (`>=1.12.13+hotfix.4`):

```yaml
...
dependencies:
  ...
  cloud_firestore: ^0.13.2
  ...
```

### Update `index.html`

Due to [this bug in dartdevc][2], you will need to manually add the Firebase
JavaScript files to your `index.html` file.

In your app directory, edit `web/index.html` to add the following:

```html
<html>
    ...
    <body>
        <script src="https://www.gstatic.com/firebasejs/7.5.0/firebase-app.js"></script>
        <script src="https://www.gstatic.com/firebasejs/7.5.0/firebase-firestore.js"></script>
        <!-- Other firebase SDKs/config here -->
        <script src="main.dart.js"></script>
    </body>
</html>
```

### Initialize Firebase

If your app is using the "default" Firebase app _(this means that you're not doing any `package:firebase_core` initialization yourself)_,
you'll need to initialize it now, following the steps in the [Firebase Web Setup][3] docs.

Specifically, you'll want to add the following lines to your `web/index.html` file:

```html
<body>
  <!-- Previously loaded Firebase SDKs -->

  <!-- ADD THIS BEFORE YOUR main.dart.js SCRIPT -->
  <script>
    // TODO: Replace the following with your app's Firebase project configuration.
    // See: https://support.google.com/firebase/answer/7015592
    var firebaseConfig = {
      apiKey: "...",
      authDomain: "[YOUR_PROJECT].firebaseapp.com",
      databaseURL: "https://[YOUR_PROJECT].firebaseio.com",
      projectId: "[YOUR_PROJECT]",
      storageBucket: "[YOUR_PROJECT].appspot.com",
      messagingSenderId: "...",
      appId: "1:...:web:...",
      measurementId: "G-..."
    };
    // Initialize Firebase
    firebase.initializeApp(firebaseConfig);
  </script>
  <!-- END OF FIREBASE INIT CODE -->

  <script src="main.dart.js"></script>
</body>
```

### Use the plugin

Once you have modified your `web/index.html` file, you should be able to use `package:cloud_firestore` as normal. Refer to the [`cloud_firestore` documentation][1] for more details.

[1]: https://pub.dev/packages/cloud_firestore
[2]: https://github.com/dart-lang/sdk/issues/33979
[3]: https://firebase.google.com/docs/web/setup#add-sdks-initialize

## Changelog
## 0.1.0+2

- Update documentation about this package being the endorsed platform for web.

## 0.1.0+1

- Fix `fileName` prop in pubspec.yaml

## 0.1.0

- Initial release






 
