Repository navigation
Cloud Functions
Luke C Hartman edited this page Nov 2, 2026
·
1 revision
Source: functions/ (entry functions/index.js). Deploy with the Firebase CLI from the app repo (see README / Technical Documentation).
| Export | Type | Purpose |
|---|---|---|
notifySlackOnNewHelpRequest |
Firestore onCreate on helpRequests
|
Slack webhook + SendGrid email |
| Export | Who | Purpose |
|---|---|---|
addUserRole |
Admin patterns in code | Clear custom claims → basic user |
addAdminRole |
Privileged | Set admin: true
|
addAgencyRole |
Privileged | Set agency claims |
backfillAgencyClaims |
Admin | Restamp claims from agency.agencyUsers
|
viewRole |
Signed-in | Decode ID token claims |
getUser / getUserByEmail / getUserRecord
|
Privileged | Look up Auth users |
authGetUserList |
Privileged | List Auth users (capped) |
deleteUser |
Privileged | Delete Auth user |
disableUser |
Self | Disable own account |
| Export | Who | Purpose |
|---|---|---|
setActiveExperiment |
Admin | settings/experiment.activeExperimentId |
addExperiment |
Admin | Add experiment entry |
backfillReportExperimentFields |
Admin | Stamp experimentId on reports |
previewBulkArchive / bulkArchiveReports
|
Admin | Count / set archived*
|
getExperimentMetrics |
Admin | Counts by experiment |
| Export | Who | Purpose |
|---|---|---|
getPipelineRuns |
Admin | Read BigQuery truth_sleuth.pipeline_runs (Truth Sleuth) |
setTemporaryPassword |
Admin | Random temp password + mustChangePassword
|
replaceTemporaryPassword |
Participant | Replace temp password after first login |
Helpers (not exported callables): help-request-email.js, experiment-config.js, modules under agency-claims.js, experiment.js, pipeline-runs.js, temporary-password.js.
Secrets commonly used: SLACK_WEBHOOK_URL, SENDGRID_API_KEY.
- Firestore schema
- Architecture
- Front-end often calls these via
AuthContext/ FirebasehttpsCallable