# Firebase in P5JS

**URL:** <https://discourse.processing.org/t/firebase-in-p5js/36080>\
**Category:** Libraries\
**Created:** [April 2, 2022, 3:44pm UTC](https://discourse.processing.org/t/firebase-in-p5js/36080 "2022-04-02T15:44:10Z")\
**Posts on this page:** 1\
**Page:** 1

<div class="post-metadata">

**Author:** ![Omri](https://avatars.discourse-cdn.com/v4/letter/o/bc79bd/32.png) [@Omri](https://discourse.processing.org/u/Omri)\
**Post date:** [April 2, 2022, 3:44pm UTC](https://discourse.processing.org/t/firebase-in-p5js/36080/1 "2022-04-02T15:44:10Z")

</div>

Hey there, I want to use firebase in my project and I follow Shiffman’s project to do so, but I think the firebase configuration has changed…

in Shiffman’s HTML he wrote:

```auto
	<script src="https://www.gstatic.com/firebasejs/5.0.4/firebase.js"></script>

```

and in the JS:

```auto
// Initialize Firebase
  var config = {
    apiKey: "AIzaSyDPekCKX4ee6h9NVR2lEITGAM0XIHn-c7c",
    authDomain: "color-classification.firebaseapp.com",
    databaseURL: "https://color-classification.firebaseio.com",
    projectId: "color-classification",
    storageBucket: "",
    messagingSenderId: "590040209608"
  };
  firebase.initializeApp(config);
  database = firebase.database();
  authPromise = firebase.auth().signInAnonymously();

```

I just opened a new Firebase project and the configurations it shows me to copy are quite different from the video, they look like that:

```auto
<script type="module">
  // Import the functions you need from the SDKs you need
  import { initializeApp } from "https://www.gstatic.com/firebasejs/9.6.10/firebase-app.js";
  import { getAnalytics } from "https://www.gstatic.com/firebasejs/9.6.10/firebase-analytics.js";
  // TODO: Add SDKs for Firebase products that you want to use
  // https://firebase.google.com/docs/web/setup#available-libraries

  // Your web app's Firebase configuration
  // For Firebase JS SDK v7.20.0 and later, measurementId is optional
  const firebaseConfig = {
    apiKey: "AIzaSyDP5vRnX9tY3SR8jEJe-rPVUqQ7KWRwwy4",
    authDomain: "my-project.firebaseapp.com",
    projectId: "my-project",
    storageBucket: "my-project.appspot.com",
    messagingSenderId: "706927492507",
    appId: "1:706927492507:web:d1k376f11b946120de4b04",
    measurementId: "G-9246EG98E6"
  };

  // Initialize Firebase
  const app = initializeApp(firebaseConfig);
  const analytics = getAnalytics(app);
</script>

```

And I can’t figure out what’s going to my HTML and what to my setup (I tried different options and got different errors).

another thing that is different than in Shiffman’s uses:

```auto
firebase.initializeApp(config);

```

and my Firebase says to do:

```auto
  const app = initializeApp(firebaseConfig);

```

any help would be amazing ☺
