I am trying to integrate latest version of firebase cloud messaging in web application using native javascript. From documentation it look like they have moved to node js approach and i am unable to find any sample code for javascript in firebase web version 9.
i have tried to add below code in JSP file to make it run :
<script type="module">
import { initializeApp } from 'https://www.gstatic.com/firebasejs/9.6.0/firebase-app.js'
// If you enabled Analytics in your project, add the Firebase SDK for Google Analytics
import { analytics } from 'https://www.gstatic.com/firebasejs/9.6.0/firebase-analytics.js'
// Add Firebase products that you want to use
import { auth } from 'https://www.gstatic.com/firebasejs/9.6.0/firebase-auth.js'
import { firestore } from 'https://www.gstatic.com/firebasejs/9.6.0/firebase-firestore.js'
</script>
but its throwing error "Uncaught ReferenceError: initializeApp is not defined".
even when i tried to add it to script file as below
<script type="text/javascript" src="https://www.gstatic.com/firebasejs/9.6.0/firebase-app.js"></script>
its throwing the same error.
I am unable to understand firebase cloud messaging integration with native JavaScript in web version 9. all code look like node js code with import statement.