Code
Hub
Workspaces
Following
Trending
Connect
MCP
copy
Create free account
hub
/
github.com/firebase/functions-samples
/ functions
Functions
169 in github.com/firebase/functions-samples
⨍
Functions
169
◇
Types & classes
2
↳
Endpoints
5
↓ 7 callers
Function
ask
(question)
Node-1st-gen/okta-auth/setup.js:83
↓ 5 callers
Function
getX
(angle)
Node-1st-gen/image-maker/functions/clock.js:33
↓ 5 callers
Function
getY
(angle)
Node-1st-gen/image-maker/functions/clock.js:37
↓ 5 callers
Function
handleResponse
(username, status, body)
Node-1st-gen/username-password-auth/functions/index.js:47
↓ 4 callers
Function
drawBlock
(x, y, level, ctx)
Node-1st-gen/image-maker/functions/ray.js:46
↓ 4 callers
Function
formatAmount
(amount, currency)
Node-1st-gen/stripe/public/javascript/app.js:272
↓ 4 callers
Function
getSlackmoji
* Convert a test result status into a Slackmoji * @param {string} term * @return {string}
Node/testlab-to-slack/functions/index.js:68
↓ 4 callers
Function
getSlackmoji
(term)
Node-1st-gen/testlab-to-slack/functions/index.js:57
↓ 4 callers
Function
slackmoji
Convert a test result status into a Slackmoji.
Python/testlab-to-slack/functions/main.py:44
↓ 3 callers
Function
authHeader
* Creates "Authorization" header value. * @return {string} Basic, base64-encoded "Authorization" header value
Node/app-distribution-feedback-to-jira/functions/index.js:75
↓ 3 callers
Function
makeKeyFirebaseCompatible
* Makes sure the given string does not contain characters that can't be used as Firebase * Realtime Database keys such as '.' and replaces them by '*
Node-1st-gen/exif-images/functions/index.js:99
↓ 3 callers
Function
postMessageToDiscord
* Posts a message to Discord with Discord's Webhook API * * @param {string} botName - The bot username to display * @param {string} messageBody - T
Node/alerts-to-discord/functions/index.js:36
↓ 3 callers
Function
post_message_to_discord
Posts a message to Discord with Discord's Webhook API. Params: bot_name: The bot username to display message_body: The message to
Python/alerts-to-discord/functions/main.py:27
↓ 2 callers
Function
format
(src: str)
Python/pyfmt.py:57
↓ 2 callers
Function
getDeviceTokens
* Get the Device Tokens for the given user. * * @param {string} uid The UID of the user.
Node-1st-gen/coupon-on-purchase/functions/index.js:123
↓ 2 callers
Function
getPointColor
(x, y)
Node-1st-gen/image-maker/functions/ray.js:60
↓ 2 callers
Function
getRedirectUri
()
Node-1st-gen/linkedin-auth/functions/index.js:40
↓ 2 callers
Function
getTemplate
(version, accessToken)
Node-1st-gen/remote-config-diff/functions/index.js:53
↓ 2 callers
Method
measureMs
* Get the time since this timer was constructed * @return {string}
Node/instrument-with-opentelemetry/functions/timer.js:29
↓ 2 callers
Function
reportError
(err, context = {})
Node-1st-gen/stripe/functions/index.js:180
↓ 2 callers
Function
secondsLeftBeforeEndOfHour
(date)
Node-1st-gen/quickstarts/big-ben/functions/index.js:68
↓ 2 callers
Function
userFacingMessage
* Sanitize the error message for the user.
Node-1st-gen/stripe/functions/index.js:221
↓ 2 callers
Function
zeroDecimalCurrency
(amount, currency)
Node-1st-gen/stripe/public/javascript/app.js:291
↓ 1 callers
Function
addDecodedIdTokenToRequest
* Returns a Promise with the Decoded ID Token and adds it to req.user.
Node-1st-gen/template-handlebars/functions/firebaseUser.js:62
↓ 1 callers
Function
analyze_photo_with_ml
(url)
Python/quickstarts/auth-blocking-functions/functions/main.py:188
↓ 1 callers
Function
appendPromise
(requestWithoutAuth)
Node-1st-gen/google-sheet-sync/functions/index.js:100
↓ 1 callers
Function
authenticate
* Authenticate the provided credentials. * TODO(DEVELOPER): In production you'll need to update this function so that it authenticates with your own
Node-1st-gen/username-password-auth/functions/index.js:99
↓ 1 callers
Function
blurImage
* Blurs the given image located in the given bucket using ImageMagick.
Node-1st-gen/moderate-images/functions/index.js:76
↓ 1 callers
Function
buildCreateIssueRequest
* Builds payload for creating a Jira issue. * @param {AlertEvent<InAppFeedbackPayload>} event
Node/app-distribution-feedback-to-jira/functions/index.js:163
↓ 1 callers
Function
calculateDiscount
* Sum discounts of all `productIds` * @param {string[]} productIds * @return {number}
Node/instrument-with-opentelemetry/functions/index.js:65
↓ 1 callers
Function
calculatePrice
* Get prices for all products in `productIds` array * @param {string[]} productIds * @return {number}
Node/instrument-with-opentelemetry/functions/index.js:47
↓ 1 callers
Function
categorizeScore
(score)
Node-1st-gen/authenticated-json-api/functions/index.js:154
↓ 1 callers
Function
check_and_diff
(files: list[str])
Python/pyfmt.py:36
↓ 1 callers
Function
clock
(ctx, colorOpts)
Node-1st-gen/image-maker/functions/clock.js:41
↓ 1 callers
Function
containsSwearwords
* Returns true if the string contains swearwords. * @param {string} message * @return {boolean}
Node/quickstarts/callable-functions/functions/sanitizer.js:44
↓ 1 callers
Function
containsSwearwords
(message)
Node-1st-gen/text-moderation/functions/index.js:65
↓ 1 callers
Function
createFirebaseAccount
* Creates a Firebase account with the given user profile and returns a custom auth token allowing * signing-in this account. * Also saves the access
Node-1st-gen/spotify-auth/functions/index.js:128
↓ 1 callers
Function
createFirebaseAccount
* Creates a Firebase account with the given user profile and returns a custom auth token allowing * signing-in this account. * Also saves the access
Node-1st-gen/instagram-auth/functions/index.js:127
↓ 1 callers
Function
createFirebaseAccount
* Creates a Firebase account with the given user profile and returns a custom auth token allowing * signing-in this account. * Also saves the access
Node-1st-gen/linkedin-auth/functions/index.js:147
↓ 1 callers
Function
createIssue
* Creates new issue in Jira. * @param {AlertEvent<InAppFeedbackPayload>} event
Node/app-distribution-feedback-to-jira/functions/index.js:85
↓ 1 callers
Function
deleteInactiveUser
* Deletes one inactive user from the list. * @param {admin.auth.UserRecord[]} inactiveUsers * @return {null | Promise<void>}
Node/delete-unused-accounts-cron/functions/index.js:58
↓ 1 callers
Function
deleteInactiveUser
* Deletes one inactive user from the list.
Node-1st-gen/delete-unused-accounts-cron/functions/index.js:43
↓ 1 callers
Function
fix_region_tags
Fix formattiing of region tags. - Remove extra blank lines after START tags. - Remove extra blank lines before END tags. - Matches indent
Python/pyfmt.py:66
↓ 1 callers
Function
formatAmountForStripe
(amount, currency)
Node-1st-gen/stripe/public/javascript/app.js:283
↓ 1 callers
Function
fs_listen_online
()
Node-1st-gen/presence-firestore/public/index.js:125
↓ 1 callers
Function
getAuthorizedClient
()
Node-1st-gen/google-sheet-sync/functions/index.js:118
↓ 1 callers
Function
getDefaultOpts
()
Node-1st-gen/image-maker/functions/clock.js:19
↓ 1 callers
Function
getFirebaseProjectId
* Returns the ID of the Firebase project.
Node-1st-gen/username-password-auth/public/main.js:21
↓ 1 callers
Function
getFunctionUrl
* Get the URL of a given v2 cloud function. * * @param {string} name the function's name * @param {string} location the function's location * @ret
Node/taskqueues-backup-images/functions/index.js:111
↓ 1 callers
Function
getIdTokenFromRequest
* Returns a Promise with the Firebase ID Token if found in the Authorization or the __session cookie.
Node-1st-gen/template-handlebars/functions/firebaseUser.js:40
↓ 1 callers
Function
getInactiveUsers
* * @param {admin.auth.UserRecord[]} [users] the current list of inactive users * @param {string} [nextPageToken] * @return {Promise<admin.auth.Use
Node/delete-unused-accounts-cron/functions/index.js:91
↓ 1 callers
Function
getInactiveUsers
* Returns the list of all inactive users.
Node-1st-gen/delete-unused-accounts-cron/functions/index.js:70
↓ 1 callers
Function
getLinkedInAccessToken
(code, clientId, clientSecret, redirectUri)
Node-1st-gen/linkedin-auth/functions/index.js:69
↓ 1 callers
Function
getLinkedInUserProfile
(accessToken)
Node-1st-gen/linkedin-auth/functions/index.js:89
↓ 1 callers
Function
get_function_url
Get the URL of a given v2 cloud function. Params: name: the function's name location: the function's location Returns:
Python/post-signup-event/functions/main.py:127
↓ 1 callers
Function
get_function_url
Get the URL of a given v2 cloud function. Params: name: the function's name location: the function's location Returns: The U
Python/taskqueues-backup-images/functions/main.py:131
↓ 1 callers
Function
handleCardAction
(payment, docId)
Node-1st-gen/stripe/public/javascript/app.js:308
↓ 1 callers
Function
handleError
(username, error)
Node-1st-gen/username-password-auth/functions/index.js:41
↓ 1 callers
Function
imageMagickOutputToObject
* Convert the output of ImageMagick's `identify -verbose` command to a JavaScript Object.
Node-1st-gen/exif-images/functions/index.js:68
↓ 1 callers
Function
isShouting
* Detect if the current message is shouting. i.e. there are too many Uppercase * characters or exclamation points. * @param {string} message message
Node/quickstarts/callable-functions/functions/sanitizer.js:63
↓ 1 callers
Function
isShouting
(message)
Node-1st-gen/text-moderation/functions/index.js:76
↓ 1 callers
Function
is_inactive
(user: auth.UserRecord, inactive_limit: timedelta)
Python/delete-unused-accounts-cron/functions/main.py:46
↓ 1 callers
Function
is_suspicious
(ip_address)
Python/quickstarts/auth-blocking-functions/functions/main.py:130
↓ 1 callers
Function
lookupReporter
* Looks up Jira user ID. * @param {string} testerEmail Email address of tester who filed feedback
Node/app-distribution-feedback-to-jira/functions/index.js:141
↓ 1 callers
Function
moderateMessage
(message)
Node-1st-gen/text-moderation/functions/index.js:48
↓ 1 callers
Function
moderateSwearwords
(message)
Node-1st-gen/text-moderation/functions/index.js:70
↓ 1 callers
Function
ownKeys
(o)
Node-1st-gen/vision-annotate-images/functions/lib/src/index.js:34
↓ 1 callers
Function
postToSlack
* Posts a message to Slack via a Webhook * @param {string} title * @param {string} details * @return {Promise<string>}
Node/testlab-to-slack/functions/index.js:32
↓ 1 callers
Function
postToSlack
* Posts a message to Slack via a Webhook * @param {string} title * @param {string} details * @return {Promise<string>}
Node-1st-gen/testlab-to-slack/functions/index.js:28
↓ 1 callers
Function
postToSlack
* Post a message to Slack about the new GitHub commit.
Node-1st-gen/github-to-slack/functions/index.js:64
↓ 1 callers
Function
post_to_slack
Posts a message to Slack via a Webhook.
Python/testlab-to-slack/functions/main.py:28
↓ 1 callers
Function
promisifyCommand
(command)
Node-1st-gen/ffmpeg-convert-audio/functions/index.js:29
↓ 1 callers
Function
reformat_in_place
(files: list[str])
Python/pyfmt.py:28
↓ 1 callers
Function
renderLevel
(minimumLevel, level, y, ctx)
Node-1st-gen/image-maker/functions/ray.js:24
↓ 1 callers
Function
replaceSwearwords
* Hide all swearwords. e.g: Crap => ****. * @param {string} message * @return {string}
Node/quickstarts/callable-functions/functions/sanitizer.js:53
↓ 1 callers
Function
rtdb_and_local_fs_presence
()
Node-1st-gen/presence-firestore/public/index.js:66
↓ 1 callers
Function
sanitize_text
(text: str)
Python/quickstarts/callable-functions/functions/main.py:140
↓ 1 callers
Function
search
(query)
Node-1st-gen/fulltext-search-firestore/public/index.js:78
↓ 1 callers
Function
searchAlgoliaAuthenticated
(query)
Node-1st-gen/fulltext-search-firestore/public/index.js:47
↓ 1 callers
Function
searchAlgoliaUnauthenticated
(query)
Node-1st-gen/fulltext-search-firestore/public/index.js:27
↓ 1 callers
Function
sendCouponViaFCM
* Sends a coupon code via FCM to the given user. * * @param {string} uid The UID of the user. * @param {string} userLanguage The user language in l
Node-1st-gen/coupon-on-purchase/functions/index.js:50
↓ 1 callers
Function
sendGoodbyeEmail
(email, displayName)
Node-1st-gen/quickstarts/email-users/functions/index.js:92
↓ 1 callers
Function
sendHighValueCouponViaFCM
* Sends a high value coupon vode via FCM to the given user. * * @param {string} uid The UID of the user. * @param {string} userLanguage The user la
Node-1st-gen/coupon-on-purchase/functions/index.js:87
↓ 1 callers
Function
sendSurveyEmail
* Sends an email pointing to the Upgraded App survey.
Node-1st-gen/survey-app-update/functions/index.js:63
↓ 1 callers
Function
sendWelcomeEmail
(email, displayName)
Node-1st-gen/quickstarts/email-users/functions/index.js:77
↓ 1 callers
Function
send_verification_email_using_your_smtp_server
(email, link)
Python/quickstarts/auth-blocking-functions/functions/main.py:91
↓ 1 callers
Function
shortenBitly
(url, token)
Node-1st-gen/url-shortener/functions/index.js:23
↓ 1 callers
Function
sliceIntoChunks
* Divide an array into chunks of `chunkSize` * @param {any[]} arr * @param {Number} chunkSize * @return {Array<Array<any>>}
Node/instrument-with-opentelemetry/functions/index.js:33
↓ 1 callers
Function
spark
(ctx, data, opts)
Node-1st-gen/image-maker/functions/sparkline.js:17
↓ 1 callers
Function
startDataListeners
* Set up Firestore data listeners
Node-1st-gen/stripe/public/javascript/app.js:92
↓ 1 callers
Function
stopShouting
* Correctly capitalize the string as a sentence (e.g. uppercase after dots) * and remove exclamation ppints. * @param {string} message message to ca
Node/quickstarts/callable-functions/functions/sanitizer.js:74
↓ 1 callers
Function
stopShouting
(message)
Node-1st-gen/text-moderation/functions/index.js:82
↓ 1 callers
Function
uploadScreenshot
* Uploads screenshot to Jira (after downloading it from Firebase). * @param {string} issueUri URI of the Jira issue * @param {string} screenshotUri
Node/app-distribution-feedback-to-jira/functions/index.js:112
↓ 1 callers
Function
weatherForecastApi
* Gets the weather from the national weather service * https://www.weather.gov/documentation/services-web-api * * @param {number} lat * @param {nu
Node/quickstarts/callable-functions-streaming/functions/index.js:28
Function
Demo
()
Node/fcm-notifications/public/main.js:19
Function
Demo
()
Node-1st-gen/quickstarts/email-users/public/main.js:19
Function
Demo
()
Node-1st-gen/spotify-auth/public/main.js:19
Function
Demo
()
Node-1st-gen/authenticated-json-api/public/main.js:19
Function
Demo
()
Node-1st-gen/fcm-notifications/public/main.js:19
Function
Demo
()
Node-1st-gen/username-password-auth/public/main.js:26
next →
1–100 of 169, ranked by callers