Follow entities

The Follow entities feature lets viewers follow and unfollow entities (players, teams, properties/competitions) directly within the Experiences SDK player. Follow state is persisted on-device automatically, and, once activity sync is enabled and the viewer is identified, synced across the viewer's devices through Experiences.

The follow button and Initialize({ followedEntities }) write the stored list. Stories, Moments, or Videos appear when the widget uses DataSourceBuilder().followedEntities(). A tap does not change the widget's data source. The button is for the Moments player. See Followed entities data source.

Unlike iOS and Android, the Web SDK doesn't expose an imperative follow-entities manager to your app. The follow button and the Initialize option below are the only two ways to write the list.

Table of contents

Persistence & sync

Out of the box

Every follow/unfollow from a tap on the follow button is written to local storage on the device immediately. This happens for every viewer, including anonymous ones, survives page reloads, and works fully offline. No backend and no extra setup are required for this baseline behavior.

Syncing across devices

If the WSC Sports team has enabled activity sync for you, and the viewer is identified (externalUserId set on each of the viewer's devices), those local changes also sync through Experiences, using the same gate and pipeline as the SDK's other user-activity signals. There's no separate follow-specific flag.

Sync is not real-time: it rides the SDK's normal periodic batch/refresh cycle, not an immediate push on every tap. A follow made on one device typically appears on another after the next sync cycle on each side, not instantly.

📘

Your app is no longer required to persist follow state itself or re-seed the SDK on every load. followedEntities (below) is for apps that want to seed from their own backend, mirror state in their own UI, or manage follow state independent of the Experiences sync. It isn't a requirement for basic persistence.

Integration

Enabling the follow button

Add the addFollowButton action handler to the Moments player:

actionHandlers: [
  {
    actionId: 'addFollowButton',
    options: {
      onClick: (e, data) => {
        // Optional: see "Handling follow/unfollow clicks" below
      },
    },
  },
],

That's sufficient for follow state to persist locally and, once activity sync is on and the viewer is identified with externalUserId, sync across the viewer's devices. The handler writes the list. It does not switch the widget onto the followed entities data source.

To hide the button, set playerStyle.followButton.isVisible to false. See Follow Button.

Seeding or replacing followed entities

followedEntities is a Web SDK Initialize option:

BlazeSDK.Initialize('<API-KEY>', {
  externalUserId: 'user-123',
  followedEntities: [
    { entityId: 'player-123', entityType: 'Player' },
    { entityId: 'team-123', entityType: 'Team' },
    { entityId: 'property-123', entityType: 'Property', providerName: 'stats-perform' }, // providerName is optional
  ],
})

Every entry is an object. entityType must be written, as undefined when the type is unknown.

followedEntities replaces the viewer's entire followed list. The new list is stored on the device, and once activity sync is on and the viewer is identified with externalUserId, that list wins on every device where the viewer is identified. Web reads this option on every Initialize call. A hardcoded or stale list on each page load erases follows from other devices and from the same session. Pass followedEntities only when that list is the viewer's complete, correct list. On any other load, leave the option out. This option writes the list. The widget source that reads the list is DataSourceBuilder().followedEntities().

Handling follow/unfollow clicks

Implement onClick on the addFollowButton action handler only if you need the event for your own purposes. It's not required for persistence or sync:

{
  actionId: 'addFollowButton',
  options: {
    onClick: (e, data) => {
      console.log(data.sourceId,
                  data.sourceContentType,
                  data.newFollowingState,
                  data.followEntity.entityType,
                  data.followEntity.entityId,
                  data.followEntity.providerName); // optional, opaque data-provider name
    },
  },
},

The internal follow state is already updated by the time this callback fires, so newFollowingState reflects the state after the click.

Data models

FollowedEntityInput

The shape accepted by Initialize({ followedEntities }):

type FollowedEntityInput = {
  entityId: string;
  providerName?: string;
  entityType: 'Player' | 'Team' | 'Property' | undefined;
};

entityType is the category: Player, Team, or Property. Passing undefined leaves any type the SDK already stored for that id. Omitting the key is a build error.

BlazeFollowEntity (content-embedded)

Your onClick callback receives this shape as data.followEntity. It represents the followable entity embedded in the content that was on screen when the viewer tapped:

type BlazeFollowEntity = {
  entityId: string;
  entityType: 'Player' | 'Team' | 'Property';
  providerName?: string;
  storageFile: { url: string; fileSize: number | null };
};

entityType is the category of that entity: Player, Team, or Property. It is not the style setting that chooses which entity the button shows. providerName is an opaque, unvalidated string that names the data provider (for example, stats-perform). The SDK forwards both fields to User Activity when the signal syncs.

Best practices

  1. Don't call Initialize with followedEntities on every page load unless you genuinely have a fresh, authoritative list. See the warning above. If you don't need to seed/override, omit the option.
  2. There's no imperative insert/remove/read API on Web. Unlike iOS/Android, your app can't add or remove a single followed entity outside of a button tap, and can't query the current followed set. If you need that level of control, the follow button tap and the followedEntities replace option are your only two levers. Those two levers only write the list. They do not switch the widget onto the followed entities data source.
  3. Treat the onClick callback as optional telemetry, not a required integration step. The SDK's own persistence and sync don't depend on it.

Troubleshooting

Follow button not appearing

  • Ensure the addFollowButton action handler is registered in your widget/player configuration
  • Verify the content has follow entities in the response (followEntities on the content object)

Follows disappearing across page loads

  • Check whether Initialize is being called with a stale or empty followedEntities list on load. See the replace warning above.

Support

For additional support or questions about the Follow entities feature, contact your WSC Sports representative or refer to the main SDK documentation.


Did this page help you?