HomeGuidesAPI ReferenceGraphQL
Submit Documentation FeedbackJoin Developer CommunityOptimizely GitHubOptimizely NuGetLog In

Notifications

This topic describes tracking significant activity via notifications in Optimizely Connect Platform (OCP).

Important account-level events can be logged to the Optimizely activity log using the SDK's notifications. Notifications are sent to OCP's activity log page which can be found in the Account Settings section of the web application. It provides detailed information regarding significant activity such as data/file load jobs, campaign execution, etc. Each notification is made up of the following fields that map to the Activity Log section in the web application.

FieldDescriptionRequired
activityThis maps to the Category column on the activity log table in the web application. This is typically an enumerated set of values that represent the activity being logged.yes
titleyes
summarySummarization of the activity. Should include important information related to the activity that is useful when viewing from the web application.yes
detailsBy default the combination of title + summary is used to create the details of the entry. By supplying this optional field you can provide additional details regarding the notification.optional

In addition to the fields, notification entries also include a related status, which is one of the following:

  • info
  • success
  • warn
  • error

SDK

The SDK exposes the notifications feature via the notifications instance, which can be imported as follows:

import {notifications} from '@zaius/app-sdk';

The notifications instance follows the SDK's Notifier interface:

export interface Notifier {
  /**
   * Create an informational notification.
   * @param activity The activity
   * @param title The title
   * @param summary The activity summary
   * @param [details] The activity details
   */
  info(activity: string, title: string, summary: string, details?: string): void;

  /**
   * Create a success notification.
   * @param activity The activity
   * @param title The title
   * @param summary The activity summary
   * @param [details] The activity details
   */
  success(activity: string, title: string, summary: string, details?: string): void;

  /**
   * Create a warning notification.
   * @param activity The activity
   * @param title The title
   * @param summary The activity summary
   * @param [details] The activity details
   */
  warn(activity: string, title: string, summary: string, details?: string): void;

  /**
   * Create an error notification.
   * @param activity The activity
   * @param title The title
   * @param summary The activity summary
   * @param [details] The activity details
   */
  error(activity: string, title: string, summary: string, details?: string): void;
}

Next