Pass available visitor info to the chat

You can pass any information about a visitor to the chat using our JavaScript API.

Example:

window.chaport = {
  app_id: '56e9162264e94eb633a095fb',
  visitor: {
    name: "Jon Snow",
    email: "[email protected]",
    custom: {
      wightsKillCount: "Over 9000"
    }
  }
}

You can pass only the fields that are specified in the corresponding JavaScript API table or created by you (see the Custom fields article).

The list of available fields is located in Settings → Visitor Info → Visitor Info Fields.

To find the API key of a field, you should click on the i icon next to the field name.

All API keys of custom fields have the following format: custom.fieldName. When passing a custom field through the API, you must put it in the “custom” block as in the above example. The field name should not contain custom..

Please note: Javascript API is only available on the Pro plan.