addProgramListener

This API lets you add a listener for program based events such as widget created event whenever any widget is published. With this API you can build your own timeline of widgets.
In case of widget created event, listener argument:

API Definition: addProgramListener

import { getPostedWidgets } from '@livelike/javascript';

function programListener({ event, message }){
	// event of type WidgetCreated
  // message is of type IWidgetPayload
}

addProgramListener({
  programId: "<Your program Id>"
}, programListener)

removeProgramListener

This API lets you remove a listener which was added using a addProgramListener API.

API Definition: removeProgramListener

import { getPostedWidgets } from '@livelike/javascript';

function programListener({ event, message }){
	// event of type WidgetCreated
  // message is of type IWidgetPayload
}

removeProgramListener({
  programId: "<Your program Id>"
}, programListener)