# Copying data from Firebase Realtime Database to a Google Sheet in real time via Cloud Functions If you're trying to do this, you came to the right place! Watch this code work in real time: See also this gist for copying in the other direction: ## Setup 1. Follow step 1 to enable Google Sheets API in your Firebase project: https://developers.google.com/sheets/api/quickstart/nodejs 2. Create a service account in your project; save the json file in the functions folder; require() it to "serviceAccount". 3. Create a spreadsheet in Drive; rename the first worksheet 'Scores'; add Player and Score headers in row 1. 4. Share it with edit access to the email address of your service acct. 5. Copy the spreadsheet id (from its URL) to the spreadsheetId string. 6. `npm install firebase-admin firebase-functions googleapis lodash` 6. Deploy this (TypeScript) code. 7. Update the keys/values in your database under /scores and watch them get updated in the sheet!