1.1.1 • Published 2 years ago

firebase-authentication-to-bigquery-export v1.1.1

Weekly downloads
111
License
MIT
Repository
github
Last release
2 years ago

Firebase Authentication to BigQuery export

An automatic tool for copying and converting Firebase Authentication data to BigQuery. Inspired by firestore-to-bigquery-export

  • Create a BigQuery dataset with tables corresponding to your Firebase Authentication.
  • This package doesn't write anything to Firebase Authentication.

Installation

npm i firebase-authentication-to-bigquery-export

import bigExport from 'firebase-authentication-to-bigquery-export'

// or

const bigExport = require('firebase-authentication-to-bigquery-export')

// then

const GCPSA = require('./Your-Service-Account-File.json')
bigExport.setBigQueryConfig(GCPSA)
bigExport.setFirebaseConfig(GCPSA)

How to

API

bigExport.setBigQueryConfig(
  serviceAccountFile // JSON
)
bigExport.setFirebaseConfig(
  serviceAccountFile // JSON
)
bigExport.createBigQueryTables()
bigExport.copyToBigQuery(
    verbose // Boolean
)
bigExport.deleteBigQueryTables()

Examples

/* 
Initialize BigQuery dataset named 'authentication' with four firebase authentication.
 */

bigExport.createBigQueryTables()
    .then(res => {
        console.log(res)
    })
    .catch(error => console.error(error))

Then, you can transport your data:

/* 
Copying and converting from Firebase Authentication data
 */
 
    bigExport.copyToBigQuery()
    .then(res => {
        console.log('Copied ' + res + ' documents to BigQuery.')
    })
    .catch(error => console.error(error))

After that, you may want to refresh your data. For the time being, the quick and dirty way is to delete your tables and make new ones:

// Deleting the given BigQuery tables.

bigExport.deleteBigQueryTables()
    .then(res => {
        console.log(res)
    })
    .catch(error => console.error(error))

Maybe you want to refresh / overwrite a single table?

// Overwrites the users BigQuery table with fresh data from Firebase Authentication

bigExport.deleteBigQueryTables()
    .then(() => {
        bigExport.createBigQueryTables()
    })
    .then(promises => {
      return bigExport.copyToBigQuery()
    })
    .then(res => {
      console.log('Copied to BigQuery.')
    })
    .catch(error => console.error(error))

Issues

Please use the issue tracker.

1.1.1

2 years ago

1.1.0

2 years ago

1.0.10

2 years ago

1.0.9

4 years ago

1.0.8

4 years ago

1.0.7

4 years ago

1.0.6

4 years ago

1.0.5

5 years ago

1.0.4

5 years ago

1.0.3

5 years ago

1.0.2

5 years ago

1.0.1

5 years ago

1.0.0

5 years ago