Skip to content

cloud_functions

YYBartT edited this page Oct 16, 2025 · 9 revisions

Cloud Functions Overview

Cloud Functions for Firebase is a server-less framework that lets you automatically run backend code in response to events triggered by Firebase features and HTTPS requests. Your JavaScript or TypeScript code is stored in Google's cloud and runs in a managed environment, meaning there is no need to manage and scale your own servers. Check the official page for more information.

Setup

Before starting to use any Firebase extensions, you are required to follow some initial configuration steps. However unlike most of the modules this is purely server-side, as you will be creating JavaScript functions that you can later call using the http_request function from inside your GameMaker project.

Functions

These are the functions in this module:



Back To Top

FirebaseCloudFunctions_Call

This function calls the cloud function with the given name and the given parameters.

This function operates asynchronously, which means that it does not immediately return the requested result. Instead, upon completion of the task, it will trigger the Social Async Event.


Syntax:

FirebaseCloudFunctions_Call(function, params, timeout=undefined)
Argument Type Description
function String The name of the function to call
params Struct or Array The parameters to pass to the function
timeout Real An optional timeout value in seconds. Defaults to 0.



Returns:

N/A


Triggers:

Social Async Event

Triggered on a successful function call:

Key Type Description
type String The string "FirebaseCloudFunctions_Call"
listener Real The async request ID
status Real The status code of the call
value String The data returned by the function call

Triggered when an error occurred:

Key Type Description
type String The string "FirebaseCloudFunctions_Call"
listener Real The async request ID
status Real The status code of the call
errorMessage String A message describing the error that occurred

Example:

async_id = FirebaseCloudFunctions_Call("my_cloud_function", {text: "Hello!", number: 100});
/// Async Social Event
if (async_load[? "listener"] != async_id) { exit; }

if (!ds_map_exists(async_load, "value")) { exit; }

show_debug_message($"Result: {async_load[? "value"]}");


Clone this wiki locally