Auth Trigger Functions

Equivalent of - https://firebase.google.com/docs/functions/callable‚Äč

onCreate trigger:

functions:
- name: myAuthOnCreateFunction
type: auth
trigger: onCreate
# NOTE: If you leave out the field 'createUser' the function will be loaded
# but won't automatically trigger on each run.
# The 'createUser' field specifies a new user record
# that will trigger this auth function.
# Keep in mind that this user will actually be created
# in the emulated Firebase Auth users!
createUser:
id: new-user-id
data: '{"email": "new-user@email.com"}'
# You can also reference a Firebase auth user from your
# production by using the 'getFromProd' field.
# This user will be copied to the emulated Firebase auth users
# and will trigger this auth function:
createUser:
getFromProd:
id: user-id-in-production

onDelete trigger:

functions:
- name: myAuthOnDeleteFunction
type: auth
trigger: onDelete
# NOTE: If you leave out the field 'deleteUser' the function will be loaded
# but won't automatically trigger on each run.
# This auth function will be triggered by deleting
# a user with the specified ID from your emulated
# Firebase Auth users.
# Keep in mind that this user will actually be deleted
# from the emulated Firebase Auth users!
deleteUser:
# A user with this ID must be present in the emulated Firebase Auth users
id: existing-user-id