updateOptions
On this page
updateOptions()
This function is used to update XP Client options.
If provided, xp_rate must be "slow", "normal", "fast", or a finite number greater than 0.
Parameters
Section titled “Parameters”| Parameter | Type | Required | Description |
|---|---|---|---|
| clientOptions | NewClientOptions | ✅ | The options to update. |
Returns
Section titled “Returns”Promise<void>
Throws
Section titled “Throws”XpFatal- if invalid parameters are provided, or invalid database connection is provided.
[JS] Example
Section titled “[JS] Example”const { updateOptions } = require("simply-xp");
(async () => { await updateOptions({ xp_rate: "fast" }); // Returns Promise<void>
await updateOptions({ dbOptions: { type: "mongodb", database: mongoClient, name: "my-custom-db", }, });})();