table-listVariable

Variables allow you to store custom data on the following entity types:

  • Team (global)

  • Customer

  • License

  • Product

  • Release

Team variables are global, and will always appear alongside scoped variables. If a scoped variable has the same key as a global variable, then the scoped variable will take precedence. This allows you to set defaults, which can later be overridden.

For example, you may define a global variable customer.language with a value of "EN". Once the customer picks a language, you set the customer variable with the same key, resulting in an override.

circle-exclamation

Types of Variables

Public

Public variables allow reading and writing from the scoped entity. For example, a customer that has authenticated on your own external application can write to their own variable.

Private

Private variables cannot be edited or read from the scoped entity. They are intended to be changed by a privileged user (admin) or service.

System

System variables are auto-generated by the system and are read-only. System variables are always prefixed. For example: sys.last_ip_address.

Data Types

Data is stored as JSON values. Variables are returned from our API in the same type they were set. This prevents you needing to manually parse strings to types on your consumers. Types available to you include:

Type
Description
Example(s)

Object

A collection of key–value pairs where keys are strings and values can be any JSON type.

Array

An ordered list of values, where each value can be any JSON type.

String

Text data enclosed in double quotes (").

Number

Numeric values, including integers and floating-point numbers.

Boolean

Logical values: true or false.

Null

Explicitly empty value.

circle-exclamation

Guidelines

Keep in mind that keys are case insensitive. You should name your keys appropriately to ensure:

  • It is not unintentionally overridden by global scope

  • It's descriptive to its purpose and source, such as prefixing with your external service name.

  • Its type can be inferred (e.g using words like 'enabled' for boolean or 'list' for an array)

  • Using namespace convention, such as if you're using an application to load a product, you may choose to set variables like product.config.loader to store product config data for the loader.

  • It's not prefixed with sys. as this is reserved for system variables only.

  • Does not contain symbols other than - , _ and .

  • Names are consistent and easily readable

Discord

Variables can be set from the Discord bot with support for all the possible types, primarily for quick on-the-go edits. However, it's limited in functionality and it's suggested you use the developer API instead.

Examples

Scope
Key
Value
Description

License

payment.invoice.id

pi_e59796d66301

Store the invoice ID of a payment from a payment processor.

License

payment.source

STRIPE

Payment source

Product

about.game

Rust

The product is a mod for Rust.

Customer

myservice.user.id

4b28778b-6301-447f-a8ff-4e6923ff82ad

Store the customer's user ID from an external service

Customer

social.account.tiktok

https://tiktok.com/user

Store the social media link of a user.

Last updated