title: Firebase database security rules to allow anonymous as well as web access
body: <p>Below rules on my firebase database allow anonymous logins through my iOS app.</p>
  
  <pre><code>{
      "rules": {
          ".read": "auth != null",
          ".write": "auth != null",
          "locations": {
        ".indexOn": "g"
      }
      }
  }
  </code></pre>
  
  <p>That works well but now I need to add access for my JS web app which works through the apiKey. How do I add that rule here?</p>