Roblox UtilitiesDevlHub Roblox Documentation

Data type

Secret

Stores secret non-printable content.

The Secret data type stores the secret content returned by HttpService:GetSecret(). It cannot be printed or logged, but can be modified using built-in functions:

Methods 2#

AddPrefixPrepends a string to the secret content.
AddSuffixAppends a string to the secret content.

AddPrefix(prefix: string): Secret#

Returns a secret formed by concatenating the supplied string to the secret content, for example prepending "Bearer" to the API key.

NameTypeDefaultDescription
prefixstringThe string to prepend to the secret content.
Returns
  • Secret — A new Secret with the prefix prepended to the original secret value.

AddSuffix(suffix: string): Secret#

Returns a secret formed by concatenating the original secret and the supplied string parameter. Useful when creating a URL containing a key and query parameters.

NameTypeDefaultDescription
suffixstringThe string to append to the secret content.
Returns
  • Secret — A new Secret with the suffix appended to the original secret value.