secrets.get

Read an allowed API key from the game process environment.

Syntax

ue.secrets.get(name: string) -> string?, error?

Configure keys with UnlockedKit

  1. Open Settings in UnlockedKit.
  2. Add the name and value under Environment keys.
  3. 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 as EXAMPLE_API_KEY; or
  • begin with ULOADER_SECRET_, such as ULOADER_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.

On this page