docs: align docs with actual auth/authType behaviour#1913
Open
IzaakGough wants to merge 1 commit into
Open
Conversation
Contributor
There was a problem hiding this comment.
Code Review
This pull request updates the JSDoc documentation for the auth and authType properties of the EventContext interface in src/v1/cloud-functions.ts. It clarifies that these fields are only populated for Realtime Database triggers, explains their behavior for unauthenticated users, and directs users to https.CallableContext.auth for Callable functions. I have no feedback to provide.
cabljac
approved these changes
Jun 18, 2026
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Add this suggestion to a batch that can be applied as a single commit.This suggestion is invalid because no changes were made to the code.Suggestions cannot be applied while the pull request is closed.Suggestions cannot be applied while viewing a subset of changes.Only one suggestion per line can be applied in a batch.Add this suggestion to a batch that can be applied as a single commit.Applying suggestions on deleted lines is not supported.You must change the existing code in this line in order to create a valid suggestion.Outdated suggestions cannot be applied.This suggestion has been applied or marked resolved.Suggestions cannot be applied from pending reviews.Suggestions cannot be applied on multi-line comments.Suggestions cannot be applied while the pull request is queued to merge.Suggestion cannot be applied right now. Please check back later.
Summary
EventContextTSDoc so it documentsauthandauthTypeas Realtime Database-specific behavior.https.CallableContext.auth, and that non-RTDB events leaveauthTypeunset rather thannull.Problem/Root Cause
The existing
EventContextcomments describedauthas applying to both Realtime Database triggers and callable functions, and describedauthTypeasnullfor non-RTDB events. That does not match the actual v1 runtime behavior: the SDK only populatesEventContext.authandEventContext.authTypefor Realtime Database triggers, while callable functions expose auth onhttps.CallableContextinstead. For non-RTDBEventContextevents,authTypeis not set.Solution/Changes
Update the
EventContextTSDoc to describe the real behavior implemented by the v1 SDK:EventContext.authas Realtime Database-onlyauth: nullhttps.CallableContext.authinstead ofEventContext.authauthTypeas Realtime Database-only and not set for non-RTDB eventsTesting
authType: "ADMIN"withauth: undefinedfor an admin write.auth: undefinedandauthType: undefined.