secrets.get
Read an allowed API key from the game process environment.
Syntax
ue.secrets.get(name: string) -> string?, error?Configure keys with UnlockedKit
- Open Settings in UnlockedKit.
- Add the name and value under Environment keys.
- Launch or restart the game from UnlockedKit.
Secret values are stored in Windows Credential Manager and are not returned to the frontend after saving.
Allowed names
Names must use uppercase ASCII letters, digits, and underscores and must either:
- end in
_API_KEY, such asEXAMPLE_API_KEY; or - begin with
ULOADER_SECRET_, such asULOADER_SECRET_EXAMPLE.
Example
local api_key = assert(ue.secrets.get("EXAMPLE_API_KEY"))If the game is started outside UnlockedKit, variables may still be supplied through the normal parent process environment:
$env:EXAMPLE_API_KEY="replace-with-your-key"Set them before starting the game.
Security
Any trusted Lua mod running in the game can read allowed environment secrets. Only run scripts you trust. Never print key values, request authorization headers, or provider responses that may contain credentials.