# User settings

# Script User Settings

Most scripts are designed to be **configurable** by the user. These configurable options can include things like group names, custom messages, and other parameters.


:::info
**Note:** The user’s **bot name** is not a setting. The user selects which bot to use when purchasing your script.

:::

# Configuring Settings

 ![](https://nyc3.digitaloceanspaces.com/smartbots-docs/uploads/20adbcf8-a916-46eb-b77b-ad6944665550/baa413f5-0767-42fd-8cb4-3825420db602/Store-user-settings-1.png?X-Amz-Algorithm=AWS4-HMAC-SHA256&X-Amz-Content-Sha256=UNSIGNED-PAYLOAD&X-Amz-Credential=DO801JV4MUMY3YAEJCWC%2F20261113%2Fnyc3%2Fs3%2Faws4_request&X-Amz-Date=20261113T140000Z&X-Amz-Expires=86400&X-Amz-Signature=5a13bb51ce67f8a2f9d6c2adbdd5ea0124447d815cb054cad80519097d6fb974&X-Amz-SignedHeaders=host&x-amz-checksum-mode=ENABLED&x-id=GetObject "left-50 =781x433")

When defining user settings, you specify three values:


1. **Variable name** — how your script references the setting.
2. **Friendly name** — how the setting appears to the user.
3. **Optional hint** — a short description to help the user.


:::warning
All settings are stored as string values. If you need a number or UUID, you should convert it appropriately within your script.

:::

# Accessing User Settings from Script

User settings can be accessed via the global `userSettings` object:

```javascript
console.log("Using group: " + userSettings.group_name);
```

## Example: Setting Defaults

An easy way to define default values is by using `Object.assign()`.

```javascript
// Define the default settings here.
const defaultSettings = {
  greetingMessage: "Hello, welcome!",
  repeatCount: 2,
  enableLogging: false
};

// Merge defaults with any values provided by the user.
const settings = Object.assign({}, defaultSettings, userSettings);

// Access the settings.
console.log(settings.greetingMessage);
```

# Specifying Settings While Developing Scripts

While developing your script, you can specify custom test values for user settings on the **Settings** tab:

 ![](https://nyc3.digitaloceanspaces.com/smartbots-docs/uploads/20adbcf8-a916-46eb-b77b-ad6944665550/6f6f1a71-3cd2-494f-aca2-8f6c21077641/Store-user-settings-2.png?X-Amz-Algorithm=AWS4-HMAC-SHA256&X-Amz-Content-Sha256=UNSIGNED-PAYLOAD&X-Amz-Credential=DO801JV4MUMY3YAEJCWC%2F20261113%2Fnyc3%2Fs3%2Faws4_request&X-Amz-Date=20261113T140000Z&X-Amz-Expires=86400&X-Amz-Signature=f1f5c76cf116e510923c1e843015cdd7b1eb14658e6dab4b6187526fd9bcca42&X-Amz-SignedHeaders=host&x-amz-checksum-mode=ENABLED&x-id=GetObject "left-50 =781x433")

New settings will automatically appear here after you add them on the **Bot Store → User Settings** screen.

# Asking the User for Settings

After purchasing the script, users see a configuration panel for their settings:

 ![](https://nyc3.digitaloceanspaces.com/smartbots-docs/uploads/20adbcf8-a916-46eb-b77b-ad6944665550/1ee8a781-26b2-4932-9f8e-3c8788e7640d/Store-user-settings-3.png?X-Amz-Algorithm=AWS4-HMAC-SHA256&X-Amz-Content-Sha256=UNSIGNED-PAYLOAD&X-Amz-Credential=DO801JV4MUMY3YAEJCWC%2F20261113%2Fnyc3%2Fs3%2Faws4_request&X-Amz-Date=20261113T140000Z&X-Amz-Expires=86400&X-Amz-Signature=30d3dc5dd438f252f29c31cd121f7879aecf68b6eb62d7871ef5706a89c7d379&X-Amz-SignedHeaders=host&x-amz-checksum-mode=ENABLED&x-id=GetObject "left-50 =781x433")

# Settings and Releases

When you publish a new release, the list of settings is saved with that release. This means future changes to user settings won’t affect existing script versions:

 ![](https://nyc3.digitaloceanspaces.com/smartbots-docs/uploads/20adbcf8-a916-46eb-b77b-ad6944665550/f52c4aa5-5a7b-422a-8f4f-c060bbe00cc0/Store-user-settings-4.png?X-Amz-Algorithm=AWS4-HMAC-SHA256&X-Amz-Content-Sha256=UNSIGNED-PAYLOAD&X-Amz-Credential=DO801JV4MUMY3YAEJCWC%2F20261113%2Fnyc3%2Fs3%2Faws4_request&X-Amz-Date=20261113T140000Z&X-Amz-Expires=86400&X-Amz-Signature=415dc7024c009d189fd2d751ecc920f81a0af4c93bd3ce809feb5281f65596c6&X-Amz-SignedHeaders=host&x-amz-checksum-mode=ENABLED&x-id=GetObject "left-50 =514x187")

You can safely rename, add, or remove settings when updating your script — previously purchased versions will continue to function normally.