Options
All .read(), .write(), and post() methods take an optional Options parameter.
It is an object containing a set of values, overrides that can be utilized to change how prefsdb.com works.
timeout
Request / query timeout. Default value is 20000 (20 seconds).
This will make a request to read data give up after 10 seconds.
onsuccess
Function to be called when data is received. Default value is null: a Promise will be returned.
The response will contain eithervalue or values fields. Which one will be set will depend whether a query returns a single value or multiple values. The number of values returned will be reported in count field.
onerror
Function to be called when the call failed or resulted in an error. Default value is null. If not provided error will not be surfaced and opportunity to respond to errors will be missed.
Error object most likely will look like this:{
success: false,
status: "error",
ts: "2026-05-18 19:22:48",
error: "400 Bad Request",
message: "Missing API key"
}