Hello i have big problem, the firebase realtime database dont save data for example
const createUserProfile = (email,user,username) => {
console.log(email);
console.log(user)
const db = getDatabase();
console.log(db)
const dbRef = ref(db, 'users/' + user.uid);
set(dbRef, {
username,
email,
createDate: getDate()
});
};
In realtime conf i have write true and read true
what i can do? its next js
all data is okay,
console.log(db) response is

and realtime database dont update
This is probably because you are not passing the Firebase app instance to the getDatabase() method.
See here in the document you need to do
import { initializeApp } from "firebase/app"; import { getDatabase } from "firebase/database"; // TODO: Replace the following with your app's Firebase project configuration // See: https://firebase.google.com/docs/web/learn-more#config-object const firebaseConfig = { // ... // The value of `databaseURL` depends on the location of the database databaseURL: "https://DATABASE_NAME.firebaseio.com", }; // Initialize Firebase const app = initializeApp(firebaseConfig); // Initialize Realtime Database and get a reference to the service const database = getDatabase(app);