params namespace Stay organized with collections Save and categorize content based on your preferences.
Functions
| Function | Description |
|---|---|
| defineBoolean(name, options) | Declare a boolean parameter. |
| defineInt(name, options) | Declare an integer parameter. |
| defineJsonSecret(name) | Declares a secret parameter that retrieves a structured JSON object in Cloud Secret Manager. This is useful for managing groups of related configuration values, such as all settings for a third-party API, as a single unit.The secret value must be a valid JSON string. At runtime, the value will be automatically parsed and returned as a JavaScript object. If the value is not set or is not valid JSON, an error will be thrown. |
| defineList(name, options) | Declare a list parameter. |
| defineSecret(name) | Declares a secret param, that will persist values only in Cloud Secret Manager. Secrets are stored internally as bytestrings. UseParamOptions.as to provide type hinting during parameter resolution. |
| defineString(name, options) | Declare a string parameter. |
| multiSelect(options) | Create a multi-select input from a series of values. |
| multiSelect(options) | Create a multi-select input from map of labels to values. |
| select(options) | Create a select input from a series of values. |
| select(optionsWithLabels) | Create a select input from a map of labels to values. |
Classes
| Class | Description |
|---|---|
| Expression |
Interfaces
| Interface | Description |
|---|---|
| MultiSelectInput | Specifies that a parameter's value should be determined by having the user select a subset from a list of pre-canned options interactively at deploy time. Will result in errors if used on parameters of type other thanstring[]. |
| SelectInput | Specifies that a parameter's value should be determined by having the user select from a list of pre-canned options interactively at deploy time. |
| SelectOptions | One of the options provided to aSelectInput, containing a value and optionally a human-readable label to display in the selection interface. |
| TextInput | Specifies that a parameter's value should be determined by prompting the user to type it in interactively at deploy time. Input that does not match the provided validationRegex, if present, will be retried. |
Variables
| Variable | Description |
|---|---|
| BUCKET_PICKER | Autogenerate a list of buckets in a project that a user can select from. |
| databaseURL | A built-in parameter that resolves to the default RTDB database URL associated with the project, without prompting the deployer. Empty string if none exists. |
| declaredParams | |
| gcloudProject | A built-in parameter that resolves to the Cloud project ID, without prompting the deployer. |
| projectID | A built-in parameter that resolves to the Cloud project ID associated with the project, without prompting the deployer. |
| storageBucket | A builtin parameter that resolves to the Cloud storage bucket associated with the function, without prompting the deployer. Empty string if not defined. |
Type Aliases
| Type Alias | Description |
|---|---|
| ParamOptions | Configuration options which can be used to customize the prompting behavior of a parameter. |
params.defineBoolean()
Declare a boolean parameter.
Signature:
exportdeclarefunctiondefineBoolean(name:string,options?:ParamOptions<boolean>):BooleanParam;Parameters
| Parameter | Type | Description |
|---|---|---|
| name | string | The name of the environment variable to use to load the parameter. |
| options | ParamOptions<boolean> | Configuration options for the parameter. |
Returns:
BooleanParam
A parameter with aboolean return type for.value.
params.defineInt()
Declare an integer parameter.
Signature:
exportdeclarefunctiondefineInt(name:string,options?:ParamOptions<number>):IntParam;Parameters
| Parameter | Type | Description |
|---|---|---|
| name | string | The name of the environment variable to use to load the parameter. |
| options | ParamOptions<number> | Configuration options for the parameter. |
Returns:
IntParam
A parameter with anumber return type for.value.
params.defineJsonSecret()
Declares a secret parameter that retrieves a structured JSON object in Cloud Secret Manager. This is useful for managing groups of related configuration values, such as all settings for a third-party API, as a single unit.
The secret value must be a valid JSON string. At runtime, the value will be automatically parsed and returned as a JavaScript object. If the value is not set or is not valid JSON, an error will be thrown.
Signature:
exportdeclarefunctiondefineJsonSecret<T=any>(name:string):JsonSecretParam<T>;Parameters
| Parameter | Type | Description |
|---|---|---|
| name | string | The name of the environment variable to use to load the parameter. |
Returns:
JsonSecretParam<T>
A parameter whose.value() method returns the parsed JSON object. ```
params.defineList()
Declare a list parameter.
Signature:
exportdeclarefunctiondefineList(name:string,options?:ParamOptions<string[]>):ListParam;Parameters
| Parameter | Type | Description |
|---|---|---|
| name | string | The name of the environment variable to use to load the parameter. |
| options | ParamOptions<string[]> | Configuration options for the parameter. |
Returns:
ListParam
A parameter with astring[] return type for.value.
params.defineSecret()
Declares a secret param, that will persist values only in Cloud Secret Manager. Secrets are stored internally as bytestrings. UseParamOptions.as to provide type hinting during parameter resolution.
Signature:
exportdeclarefunctiondefineSecret(name:string):SecretParam;Parameters
| Parameter | Type | Description |
|---|---|---|
| name | string | The name of the environment variable to use to load the parameter. |
Returns:
SecretParam
A parameter with astring return type for.value.
params.defineString()
Declare a string parameter.
Signature:
exportdeclarefunctiondefineString(name:string,options?:ParamOptions<string>):StringParam;Parameters
| Parameter | Type | Description |
|---|---|---|
| name | string | The name of the environment variable to use to load the parameter. |
| options | ParamOptions<string> | Configuration options for the parameter. |
Returns:
StringParam
A parameter with astring return type for.value.
params.multiSelect()
Create a multi-select input from a series of values.
Signature:
exportdeclarefunctionmultiSelect(options:string[]):MultiSelectInput;Parameters
| Parameter | Type | Description |
|---|---|---|
| options | string[] |
Returns:
params.multiSelect()
Create a multi-select input from map of labels to values.
Signature:
exportdeclarefunctionmultiSelect(options:Record<string,string>):MultiSelectInput;Parameters
| Parameter | Type | Description |
|---|---|---|
| options | Record<string, string> |
Returns:
params.select()
Create a select input from a series of values.
Signature:
exportdeclarefunctionselect<T>(options:T[]):SelectInput<T>;Parameters
| Parameter | Type | Description |
|---|---|---|
| options | T[] |
Returns:
SelectInput<T>
params.select()
Create a select input from a map of labels to values.
Signature:
exportdeclarefunctionselect<T>(optionsWithLabels:Record<string,T>):SelectInput<T>;Parameters
| Parameter | Type | Description |
|---|---|---|
| optionsWithLabels | Record<string, T> |
Returns:
SelectInput<T>
params.BUCKET_PICKER
Autogenerate a list of buckets in a project that a user can select from.
Signature:
BUCKET_PICKER:ResourceInputparams.databaseURL
A built-in parameter that resolves to the default RTDB database URL associated with the project, without prompting the deployer. Empty string if none exists.
Signature:
databaseURL:Param<string>params.declaredParams
Signature:
declaredParams:SecretOrExpr[]params.gcloudProject
A built-in parameter that resolves to the Cloud project ID, without prompting the deployer.
Signature:
gcloudProject:Param<string>params.projectID
A built-in parameter that resolves to the Cloud project ID associated with the project, without prompting the deployer.
Signature:
projectID:Param<string>params.storageBucket
A builtin parameter that resolves to the Cloud storage bucket associated with the function, without prompting the deployer. Empty string if not defined.
Signature:
storageBucket:Param<string>params.ParamOptions
Configuration options which can be used to customize the prompting behavior of a parameter.
Signature:
exporttypeParamOptions<Textendsstring|number|boolean|string[]>=Omit<ParamSpec<T>,"name"|"type">;Except as otherwise noted, the content of this page is licensed under theCreative Commons Attribution 4.0 License, and code samples are licensed under theApache 2.0 License. For details, see theGoogle Developers Site Policies. Java is a registered trademark of Oracle and/or its affiliates.
Last updated 2025-11-10 UTC.