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
| Name | Type / Returns | Description |
|---|---|---|
| Secret:AddPrefix | Secret | Prepends a string to the secret content. |
| Secret:AddSuffix | Secret | Appends 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
| Name | Type | Default | Description |
|---|---|---|---|
| prefix | string | The string to prepend to the secret content. |
Returns
| Type | Description |
|---|---|
| Secret | A 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
| Name | Type | Default | Description |
|---|---|---|---|
| suffix | string | The string to append to the secret content. |
Returns
| Type | Description |
|---|---|
| Secret | A new Secret with the suffix appended to the original secret value. |
Code samples: View on Creator Hub (Secret-AddSuffix).