I'm trying to create a document in Firebase Firestore. I have manually added documents to it in the Web UI, but am unable to do it programmatically.

The following is a single HTML file, containing all the code, which is directly taken from [the docs](https://firebase.google.com/docs/firestore/quickstart#add_data):

```
<!-- The core Firebase JS SDK is always required and must be listed first -->
<script src="https://www.gstatic.com/firebasejs/8.3.1/firebase-app.js"></script>
<script src="https://www.gstatic.com/firebasejs/8.3.1/firebase-firestore.js"></script>

<script>
    // Your web app's Firebase configuration
    var firebaseConfig = {
        apiKey: "<REDACTED>",
        authDomain: "<REDACTED>",
        projectId: "<REDACTED>",
        storageBucket: "<REDACTED>",
        messagingSenderId: "<REDACTED>",
        appId: "<REDACTED>"
    };
    // Initialize Firebase
    firebase.initializeApp(firebaseConfig);

    var db = firebase.firestore();

    // example from the docs
    db.collection("users").add({
        first: "Ada",
        last: "Lovelace",
        born: 1815
    })
        .then((docRef) => {
            console.log("Document written with ID: ", docRef.id);
        })
        .catch((error) => {
            console.error("Error adding document: ", error);
        });
</script>

```

I have redacted the config object, but it was copied directly from the Firebase config page (furthermore, I know the config is correct because in another app (not pictured), Firebase Auth works just fine).

Upon opening the above HTML page, I get the following error in the console:

```
Error adding document:  FirebaseError: Missing or insufficient permissions.

```

My Firestore security rules are as follows. They should be completely open to all reads and writes:

```
rules_version = '2';
service cloud.firestore {
  match /databases/{database}/documents {
    match /{document=**} {
      allow read, write, update, delete, create: if true;
    }
  }
}

```

Despite the "Missing or Insufficient Permissions" error, when I go to the "Monitor Rules" tab of the Firestore Rules page, I don't see any stats for the denied requests, as if the rules didn't even get evaluated at all, despite me having ran at least 50 requests over the last 24 hours:
[![No denied requests](https://i.stack.imgur.com/s3XNN.png)](https://i.stack.imgur.com/s3XNN.png)

Running simulated Firestore requests in the Firestore Rules Playground succeeds every time as expected, whether the request is "authenticated" or not.

Please advise, I am at a loss for what else to try.