Broadleaf Microservices
  • v1.0.0-latest-prod

Content Targeter

Operations for managing Content Targeters.

Table of Contents

Get Content Item

Operation

PersonalizationClient#getContentItem(name, options);

Parameters

Parameter Type Required? Description

name

string

The name of a ContentTargeter to be used. Can be null to look through all targeters.

options

PersonalizationClientCallOptions

Options passed to the HTTP request call to customize the request configuration.

Response

This function returns a ContentItem.

Example

Example of retrieving a content item
const name = 'Homepage Banner Ad';
const targeterContext = {
    locale: 'en-US',
    customer: {
      authenticated: false
    }
  };
const contentItem = await personalizationClient.getContentItem(name, { targeterContext });

console.log(contentItem);