1 min read

Source: Roblox Creator Hub · CC BY 4.0 · View source · Code samples: MIT Imported 2026-10-03. Formatting adapted for this site.

Secret

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:

Code samples: View on Creator Hub (Secret-Overview).

Methods

NameType / ReturnsDescription
Secret:AddPrefixSecretPrepends a string to the secret content.
Secret:AddSuffixSecretAppends a string to the secret content.

Secret:AddPrefix

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

Parameters

NameTypeDefaultDescription
prefixstringThe string to prepend to the secret content.

Returns

TypeDescription
SecretA new Secret with the prefix prepended to the original secret value.

Code samples: View on Creator Hub (Secret-AddPrefix).

Secret:AddSuffix

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.

Parameters

NameTypeDefaultDescription
suffixstringThe string to append to the secret content.

Returns

TypeDescription
SecretA new Secret with the suffix appended to the original secret value.

Code samples: View on Creator Hub (Secret-AddSuffix).