Search code examples
firebasefirebase-authenticationfirebase-admin

How to add Firebase auth onCreate listener in Admin Sdk


I want to run a listener in Firebase Admin SDK that runs whenever a new account is created. It is possible to do this in cloud functions as shown here: https://firebase.google.com/docs/functions/auth-events#trigger_a_function_on_user_creation. Can the same be done in Firebase Admin SDK?


Solution

  • Nope. There is no onCreate listener in the Auth SDKs.

    Since creating a user from the authentication SDK happens completely under control of your code, you're expect to handle any downstream actions in your own code once the user creation completes.

    For example, in the documentation on creating a user with the Admin SDK for Node.js, you can put any code that needs to run after the user has been created in the then() callback.