User variables: values your program keeps on the server for each customer
Your program can now keep small values on the PWF Auth server for each customer: a setting, a theme, a counter, a flag, a saved state. They follow the customer to a new PC, and you can see and change every one of them in the panel. No server of your own needed.
- In your program, after sign-in:
SetVariableAsync("theme", "dark"),GetVariableAsync("theme")(null when never set),GetVariablesAsync(),DeleteVariableAsync("seen_intro"). The Python package hasset_variable,get_variable,get_variablesanddelete_variable. Any other client callsPOST /api/auth/var.phpwith the session, the same encrypted envelope as the heartbeat. - In the panel: open a key in Licences or an account in Users; the side panel has a Variables section with every name and value, when it last changed and who changed it. Change a value, remove one, or add one yourself, for example
tier = vip, and the program reads it on its next start. - From your own scripts: the Developer API reads and writes them too:
GET /keys/{key}/vars,PUT /keys/{key}/vars/{name}with{"value": "…"},DELETE /keys/{key}/vars/{name}. Your store or bot can set a value when an order is paid.
A variable belongs to one customer of one app: nobody else's program can read it. Each customer can have up to 50, each value up to 4 KB of text. Deleting the key or the account deletes its variables. A banned, paused or expired key gets nothing, as with texts. Docs: User variables.