Skip to content
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.

Parameter Type Required Description
clientOptions NewClientOptions ✅ The options to update.
  • Promise<void>
  • XpFatal - if invalid parameters are provided, or invalid database connection is provided.
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",
},
});
})();