Skip to content

Key-value pairs

In-app message objects may carry key-value pairs as their extras property. These are specified on the dashboard under Settings when creating an in-app message campaign. These can be used to send data with an in-app message for further handling by your site. For example:

1
2
3
4
5
6
7
8
9
10
11
12
13
import * as braze from "@braze/web-sdk";

braze.subscribeToInAppMessage(function(inAppMessage) {
  if (inAppMessage instanceof braze.InAppMessage) {
    const extras = inAppMessage.extras;
    if (extras) {
      for (const key in extras) {
        console.log("key: " + key + ", value: " + extras[key]);
      }
    }
  }
  braze.showInAppMessage(inAppMessage);
});
WAS THIS PAGE HELPFUL?
New Stuff!