Shopping Muse Using React Native SDK

Powered by the Assistant endpoint, Shopping Muse provides your site visitors with a conversational product discovery experience. The API processes user inputs in real time, identifying intent and contextual cues to deliver highly relevant, personalized product suggestions.

šŸ“˜

For more information see the following:

Parameters

ParameterData Structure TypeMandatory?Description
pagePageYesInformation about the current page (for example, homePage, categoryPage). Used for campaign targeting and context.
textStringYesThe user’s message sent to the Shopping Muse assistant.
chatIdStringNoIdentifier of an existing conversation. Pass this to continue a previous chat; omit it to start a new conversation.
pageAttributesMap<String, PageAttribute>?NoAdditional page‑level attributes (for example, category, user intent) used for targeting and personalization.
branchIdStringNoBranch identifier for multi‑branch setups (stores, financial institutions, restaurants).
optionsAssistantOptionsNoAdditional configuration for the assistant request (for example, analytics or behavior flags, when available).

Code example

async function chatWithAssistantExample() {

  await assistant.chatWithAssistant({
    page: Page.categoryPage({
      location: 'category-page',
      categories: ['kids', 'shhoes'] 
    }),
    text: 'I want to buy something nice'
  })
  .then((result) => {

    switch (result.status) {
      case 'SUCCESS':
      case 'WARNING': {

        const variation = result.choices?.[0]?.variations?.[0];
        const data = variation?.payload?.data;

        if (data) {

          if (data.assistant) {
            // present helper to the customer
          }

          if (data.chatId) {
            // add chatId to the following request
          }

          data.widgets?.forEach((widget) => {
            const title = widget.title;
            console.log('Widget title:', title);

            const slots = widget.slots;
            if (slots) {
              for (const slot of slots) {
                const productData = slot.productData as DefaultRecsProductData | undefined;
                console.log(productData?.group_id ?? '');
                console.log(productData?.name ?? '');
                console.log(productData?.url ?? '');
                console.log(productData?.price ?? '');
                console.log(productData?.in_stock ?? '');
                console.log(productData?.image_url ?? '');
                console.log(productData?.categories ?? '');
                console.log(productData?.keywords ?? '');
              }
            }
          });
        }

        break;
      }

      case 'ERROR':
        // handle error
        break;
    }

  })
  .catch((error) => {
    // handle error that happened during the request, like wrong parameter
  });
}
``

Shopping Muse campaign

AssistantPayload

PropertyData Structure TypeDescription
typeSHOPPING_MUSEThe decision type
dataAssistantDataThe variation data

AssistantData

PropertyData Structure TypeDescription
assistantStringThe assistant’s textual response for the current step in the conversation
widgetsWidget[]A list of widgets representing the structured content returned by the assistant (product lists, answer cards, and so on)
supportBooleanIndicates whether the assistant supports follow‑up user queries within the same session
chatIdStringThe unique identifier of the current Shopping Muse conversation session