Map

The map system takes key:value pairs as input and if they meet certain criteria, transforms them into some other key:value pairs and outputs them.

Take the following example:

{
  "id": "playersLike",
  "source": "viewers",
  "where": {
    "key": ["players", "<playerId>", "reaction"],
    "type": "string",
    "name": "<reaction>"
    "$in": ["like", "love", "laugh", "surprised", "sad", "mad"]
  },
  "key": ["players", "<playerId>", "reaction"],
  "value": "<reaction>"
}

This mapping is forwarding the same key:value if the key meets a specific pattern and if the value is a string in the specified list.

Map schema

id

Some string uniquely referencing the map; useful for modifying the map after its creation.

source

The source indicating where the event originates from. For now, only “viewers” is supported, but “chat” and “logs” are also planned for a later release.

where

Conditions to be met in order to produce another key:value pair. See Where schema for details.

key

An array of strings representing the new key produced.

Each string can be either:

  • Alphanumeric string: A plain literal value.
  • <anyText>: A named value taken from the input key.

value

Specifies what value to assign the key to.

Values produced by the map can be either:

  • <anyText>: Uses a named value taken from the input key.
  • String: Uses a plain literal string value.
  • Number: Uses any numeric value.
  • Boolean: Uses a boolean value (true or false).