I have downloaded the zip of Firebase real-time database node.js sample
and navigate to the database section
https://github.com/firebase/quickstart-node
How to download your serviceAccountKey.json file
1. Open Your firebase project
2. On the navigation drawer, select the project overview
3. Then select "Project settings"
4. On the new page, Select Service Accounts
5. Download file and store in a secured place.
Note: Do not commit this file to git or share with authorized users.
Go to settings -> Service Account -> Generate New private key
That will download the required Json
It's a JSON file generated in the Firebase Console (see Add Firebase to your App) containing credentials about your corresponding Service Account.
require('path/to/serviceAccountKey.json')
means - call this file to be used in the file you are calling it
serviceAccountKey.json is a file that you have to generate
If you look at this page 'Add Firebase To Your App' https://firebase.google.com/docs/ios/setup under 'Add Firebase to your app' - it says Navigate to the Service Accounts and generate a new private key, doing this will generate what will be your 'serviceAccountKey.json' file after you rename it
place that file in the directory of your choosing local to your cloud code directory, have a look at this comment https://stackoverflow.com/a/42634321/2472466 for more insight into step 4