params namespace

Functions

FunctionDescription
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

ClassDescription
Expression

Interfaces

InterfaceDescription
MultiSelectInputSpecifies 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[].
SelectInputSpecifies that a parameter's value should be determined by having the user select from a list of pre-canned options interactively at deploy time.
SelectOptionsOne of the options provided to aSelectInput, containing a value and optionally a human-readable label to display in the selection interface.
TextInputSpecifies 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

VariableDescription
BUCKET_PICKERAutogenerate a list of buckets in a project that a user can select from.
databaseURLA 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
gcloudProjectA built-in parameter that resolves to the Cloud project ID, without prompting the deployer.
projectIDA built-in parameter that resolves to the Cloud project ID associated with the project, without prompting the deployer.
storageBucketA 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 AliasDescription
ParamOptionsConfiguration 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

ParameterTypeDescription
namestringThe name of the environment variable to use to load the parameter.
optionsParamOptions<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

ParameterTypeDescription
namestringThe name of the environment variable to use to load the parameter.
optionsParamOptions<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

ParameterTypeDescription
namestringThe 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

ParameterTypeDescription
namestringThe name of the environment variable to use to load the parameter.
optionsParamOptions<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

ParameterTypeDescription
namestringThe 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

ParameterTypeDescription
namestringThe name of the environment variable to use to load the parameter.
optionsParamOptions<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

ParameterTypeDescription
optionsstring[]

Returns:

MultiSelectInput

params.multiSelect()

Create a multi-select input from map of labels to values.

Signature:

exportdeclarefunctionmultiSelect(options:Record<string,string>):MultiSelectInput;

Parameters

ParameterTypeDescription
optionsRecord<string, string>

Returns:

MultiSelectInput

params.select()

Create a select input from a series of values.

Signature:

exportdeclarefunctionselect<T>(options:T[]):SelectInput<T>;

Parameters

ParameterTypeDescription
optionsT[]

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

ParameterTypeDescription
optionsWithLabelsRecord<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:ResourceInput

params.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.