firebase-admin-node icon indicating copy to clipboard operation
firebase-admin-node copied to clipboard

[FR] Auth: Provide an API to create/update users without unneeded API requests

Open brettwillis opened this issue 1 year ago • 1 comments

The updateUser() and createUser() methods always perform two API requests under the hood: (1) the create/update request, and (2) a subsequent getUser() request.

In latency-sensitive applications where the result of getUser() is not required, this means an extra un-needed sequential round-trip network request. This fact is not apparent from the API or documentation.

Proposal

Add a second, optional parameter to createUser() and updateUser() called something like noFetchUserRecord which defaults to false (existing behaviour). If true, the getUser() request will be skipped, and the function will return Promise<void>, avoiding the un-needed round-trip request.

brettwillis avatar Aug 22 '22 23:08 brettwillis

I found a few problems with this issue:

  • I couldn't figure out how to label this issue, so I've labeled it for a human to triage. Hang tight.
  • This issue does not seem to follow the issue template. Make sure you provide all the required information.

google-oss-bot avatar Aug 22 '22 23:08 google-oss-bot