@grouparoo/braze

Last Updated: 2021-10-12

Grouparoo's Braze Plugin enables you to export users to Braze.

This guide will show you how to work with Braze Plugin to create a Destination to export your data.

Install the Braze Plugin

To work with the Braze Plugin, you must first install it in an existing Grouparoo project. You can do this using the install command from our CLI:

$ grouparoo install @grouparoo/braze

This adds the package to your package.json file as a dependency, and also drops the Plugin in the grouparoo.plugins section in that same file, which enables it.

// package.json
{
// ...
"dependencies": {
"@grouparoo/braze": "...",
// ...
},
"grouparoo": {
"plugins": [
"@grouparoo/braze",
// ...
]
}
}

Once the Plugin is installed, you'll be working primarily with the CLI's configuration commands to get everything set up.

Create a Braze App

With Grouparoo, an App is how we establish a connection with a Source or Destination. Add this connection by generating an App:

$ grouparoo generate braze:app my_braze_app

This will generate a file at config/apps/my_braze_app.js. Open this file and edit the connection details to match your desired configuration. Here is an example of what this config object will look like after generation:

// config/apps/my_braze_app.js
exports.default = async function buildConfig() {
return [
{
class: "app",
id: "my_braze_app",
name: "my_braze_app",
type: "braze",
options: {
}
},
];
};

Validating & Applying Your Config

You can validate your config at any time using the validate command:

$ grouparoo validate

And you can apply that config (save it to your Grouparoo application's database) using the apply command:

$ grouparoo apply

Create a Braze Destination

Once your App exists, you can generate a Braze Destination using the generate command. You must specify a parent, which should match the id of the App you just created.

This is the simplest form of Generator for Destinations:

$ grouparoo generate braze:destination braze_destination --parent my_braze_app

This would generate a config file at config/destinations/braze_destination.js in your Grouparoo project. You can then edit this file to match your desired configuration. Here is an example of what this config object will look like after generation:

// config/destinations/braze_destination.js

exports.default = async function buildConfig() {
  return [
    {
      id: "braze_destination",
      name: "braze_destination",
      class: "destination",
      type: "braze-export",
      appId: "my_braze_app",
      groupId: "...",
      syncMode: "...",

      mapping: {
        external_id: "userId",
        email: "email",
        first_name: "firstName",
        last_name: "lastName",
      },

      destinationGroupMemberships: {
        "High Value Customers": "highValueCustomers",
      },
    },
  ];
};

For more information on what all these properties mean and how to configure them, see Configuring your Destination.

Sync Modes

Braze Destination supports all three sync modes:

  • Sync (sync): Add, update, and remove Records as needed.
  • Additive (additive): Add and update Records as needed, but do not remove anybody.
  • Enrich (enrich): Only update Records that already exist in the Destination. Do not add or remove anybody.

You can set the desired Sync Mode through the syncMode Property in the config file:

syncMode: "additive",

Property Mappings

These mappings are what tell Grouparoo which Properties you want to sync to the Destination and what they should be called. For this Plugin, Grouparoo Properties map to Braze User Attributes.

For Braze, Mapping the external_id Property is always required, this Property can be any unique string.

You can also map to custom attributes that you've defined on Braze by simply adding them along with the others.

Here's an example of how this would look in the config file. Note that the keys refer to Braze Attribute names and values refer to Grouparoo Property IDs.

mapping: {
  external_id: "userId",
  email: "email",
  first_name: "firstName",
  last_name: "lastName",
},

Group Mappings

You can use Group Memberships to automatically add Braze Groups to your contacts. In braze, the groups are stored in an array Property called Groups.

Here's an example of how to configure this in the config file. Keys refer to the name of the tag to be shown on Braze and values refer to the Grouparoo Group ID.

destinationGroupMemberships: {
  "High Value Customers": "highValueCustomers",
},

Braze Next Steps

Once you have the Plugin installed, App created, and a Source or Destination configured, you are ready to validate, apply, then import or export your data!