Metadata

Metadata is only relevant when using an SDK.

Metadata is a way of attaching arbitary information to a particular character message.

For example, you might want to pass back an animation name to play on a character, or a colour to change the background to!

It is comprised of an object with key-value pairs. It will be sent within the message payload, and a client can then use that information however they like.

In 'simple mode', the values will all be sent through to a client as strings.

In 'advanced mode', it's possible to author complex structures, which can be any JSON-serialisable value, and these will be sent through to the client as-is. (Note some SDKs do not yet support 'advanced mode'.)

The metadata manager on a Character node, showing two entries for `play-animation` and `change-background`.

For example, this will come through in the JavaScript SDK like this:

// the below is the `event` in:
// conversation.on("message", (event) => { ... })
{
  // other fields...
  "message": {
    "text": "The character reply...",
    "metadata": {
      "play-animation": "wave",
      "change-background": "red"
    }
  }
}