I want to authenticate my node.js app to write data to the Firebase Realtime Database and allow clients to read. The structure of my DB schema right now is:
"<db_name>": {
  "users": { ... }
}
This is the rules config I've got so far:
{
  "rules": {
    "users": {
      "$uid": {
        ".read": "$uid === auth.uid",
        ".write": true
      },
      ".write": true
    }
  }
}
Shouldn't this at least allow all write access to the DB? And also, I tried searching for official documentation of how to authenticate the server app with the Firebase DB but what I can find is only how to use the Firebase Admin (which is not what I need).
In my code I do:
const firebaseConfig = {
  "apiKey": "xxx",
  "authDomain": "xxx.firebaseapp.com",
  "databaseURL": "https://xxx.firebaseio.com",
  "projectId": "xxx",
  "storageBucket": "xxx.appspot.com",
  "messagingSenderId": "xxx"
}
firebase.initializeApp(firebaseConfig);
But this is just to initialize the connection. I also need to authorize my server with Firebase somehow, through long-lasting token or smth, I am not sure...
Here's the only sensible thing I found, but it's from 2015 and the API has changed.