<?xml version="1.0" encoding="UTF-8"?>
<rss version="2.0" xmlns:atom="http://www.w3.org/2005/Atom" xmlns:dc="http://purl.org/dc/elements/1.1/">
  <channel>
    <title>Forem: youssefdev98</title>
    <description>The latest articles on Forem by youssefdev98 (@youssefdev98).</description>
    <link>https://forem.com/youssefdev98</link>
    <image>
      <url>https://media2.dev.to/dynamic/image/width=90,height=90,fit=cover,gravity=auto,format=auto/https:%2F%2Fdev-to-uploads.s3.amazonaws.com%2Fuploads%2Fuser%2Fprofile_image%2F892651%2Fafc02bd6-23c3-4b15-8604-d5e2edb801dd.png</url>
      <title>Forem: youssefdev98</title>
      <link>https://forem.com/youssefdev98</link>
    </image>
    <atom:link rel="self" type="application/rss+xml" href="https://forem.com/feed/youssefdev98"/>
    <language>en</language>
    <item>
      <title>How to save data in Firebase Realtime Database ? (Javascript)</title>
      <dc:creator>youssefdev98</dc:creator>
      <pubDate>Fri, 15 Jul 2022 21:10:16 +0000</pubDate>
      <link>https://forem.com/youssefdev98/how-to-save-data-in-firebase-realtime-database-javascript-3f4f</link>
      <guid>https://forem.com/youssefdev98/how-to-save-data-in-firebase-realtime-database-javascript-3f4f</guid>
      <description>&lt;p&gt;Hey, i need to store some simple data on the firebase realtime database, i've connected my app to the firebase realtime database, and imported all the requirments in the javascript file, but whenever my code is done, i check the realtime database and find that nothing is stored, i've followed many tutorials on youtube, even the firebase tutorial on youtube, but the mentionned problem stays, the realtime database stays empty as if i didn't write any code. Here is the javascript code :&lt;br&gt;
&lt;/p&gt;

&lt;div class="highlight js-code-highlight"&gt;
&lt;pre class="highlight plaintext"&gt;&lt;code&gt;import { initializeApp } from 'firebase/app';
import { getDatabase, ref, set } from 'firebase/database';


const firebaseConfig  = initializeApp({
    apiKey: "AIzaSyChK5qg7AJi0_AZQAc2iWnvDVJjyJvz5iI",
    authDomain: "mycoolapp-4373a.firebaseapp.com",
    databaseURL: "https://mycoolapp-4373a-default-rtdb.firebaseio.com",
    projectId: "mycoolapp-4373a",
    storageBucket: "mycoolapp-4373a.appspot.com",
    messagingSenderId: "895684408479",
    appId: "1:895684408479:web:3341db270dcd768e085eaa"
});
const app = initializeApp(firebaseConfig);

function writeUserData(userId, username, email, message) {
    const db = getDatabase();
    const reference = ref(db, 'users/' + userId);

    set(reference, {
        username: username,
        email: email,
        message: message
    });
}

writeUserData("andrew","andrew__8","andrew@gmail.com", "hey..i'm andrew!!");

&lt;/code&gt;&lt;/pre&gt;

&lt;/div&gt;



&lt;p&gt;Is there something i missed ?&lt;br&gt;
Thank you in Advance !!!&lt;/p&gt;

</description>
      <category>webdev</category>
      <category>javascript</category>
      <category>firebase</category>
      <category>database</category>
    </item>
  </channel>
</rss>
