How to use the firebase-function-tools/lib/users.listAllUsers function in firebase-function-tools

To help you get started, we’ve selected a few firebase-function-tools examples, based on popular ways it is used in public projects.

Secure your code as it's written. Use Snyk Code to scan source code in minutes - no build needed - and fix issues immediately.

github TarikHuber / react-most-wanted / packages / cra-template-rmw / template / functions / db / usersCount / onDelete.f.js View on Github external
export default database.ref('/users_count').onDelete((data, context) => {
  const getDBUsers = admin
    .database()
    .ref('users')
    .once('value')
  const getAuthUsers = usersUtil.listAllUsers()

  return Promise.all([getDBUsers, getAuthUsers]).then(resulsts => {
    const dbUsers = resulsts[0]
    const authUsers = resulsts[1]
    let promises = []

    let userUids = []
    let providerCount = {}
    let usersPublicData = {}
    let usersNotificationTokens = {}

    authUsers.forEach(userRecord => {
      const user = userRecord.toJSON()
      let userPublicProviderData = {}

      const creationTime = moment(user.metadata.creationTime)

firebase-function-tools

firebase-function-tools

MIT
Latest version published 4 years ago

Package Health Score

60 / 100
Full package analysis