Dev Guide
Dev GuideUser GuideGitHubNuGetDevCommunitySubmit a ticketLog In
GitHubNuGetDevCommunitySubmit a ticket

Activity Log notifications

Track significant activity through notifications in the Optimizely Data Platform (ODP) Activity Log.

You can log important account-level events to the Optimizely Data Platform (ODP) Activity Log using the App SDK's notifications. The ODP Activity Log provides detailed information regarding significant activity such as data/file load jobs, campaign execution, and more. Each notification is made up of the following fields, which are required unless otherwise marked:

  • activity – Typically an enumerated set of values that represent the activity being logged. Maps to the Activity column in the ODP Activity Log table.
  • title – Title for the activity being logged. Maps to the View Details column in the ODP Activity Log table.
  • summary – Summary of the activity being logged. Should include important information related to the activity. Maps to the View Details column in the ODP Activity Log table.
  • details – (Optional) By 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. Maps to both the Details and View Details columns in the ODP Activity Log table.

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

  • info
  • success
  • warn
  • error

Enable notifications using the App SDK

The App SDK exposes the notifications feature through the notifications instance, which you can import as follows:

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

The notifications instance follows the App 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;
}

To send a notification, call the appropriate method on the notifications instance. For example:

notifications.success('Nightly Import Job', 'Import succeeded', 'Imported 10 items', 'Details');