Topic preferences

The Batch Web SDK allows you to:

  • Add or remove topic preferences from a user profile (the profile is created automatically if it doesn’t already exist).

  • Partially update topic preferences within a user profile.

Requires SDK 4.3+

Here’s how to update topic preferences:

batchSDK(async api => {
    const profile = await api.profile();
    await profile.edit(editor => {
      editor.setTopicPreferences(["technology", "finance"]) // null to erase
      // Alternatively, partially update them with:
      editor.addToTopicPreferences(["investing"])
      editor.removeFromTopicPreferences(["travel"])
    })
});
circle-info

Note: Topics must be a valid List of String not longer than 25 items. String should be made of letters, numbers or underscores ([a-z0-9_]) and can't be longer than 300 characters.

Last updated