I have setup a Firebase account and a database.
I have copied the config with the API key into my Python code.
I still get a 401 Permission denied error on P
set method is missing the user['idToken'], and you forgot to authenticate, try:
import pyrebase
config = {
"apiKey": "*****",
"authDomain": "***-bot.firebaseapp.com",
"databaseURL": "https://***-bot.firebaseio.com",
"storageBucket": "ebo-bot.appspot.com"
}
firebase = pyrebase.initialize_app(config)
db = firebase.database()
auth = firebase.auth()
user = auth.sign_in_with_email_and_password("usernamehere@user.com", "passwordhere")
data = {"name": "Mortimer 'Morty' Smith"}
db.child("users").child("Morty").set(data,user['idToken'])
(you also need to create an user before running this, go to your firebase dashboard and click on the authentication tab, you can add users there)