Mirra
BuildEvents

Activity Feed Events

Activity feed events fire when new items are created in your Mirra activity feed. These events enable you to react to system notifications and actionable items.


Event Types

activity_feed_update

The activity_feed_update event fires when a new feed item is created in your activity feed.

Event Type:

type: 'activity_feed_update'
source: 'feed'

Fields:

content.text (string)

Feed item description.

feed.feedItemId (string)

Unique feed item identifier.

feed.entityId (string)

Associated entity ID.

feed.name (string)

Feed item title.

feed.description (string)

Feed item description.

feed.subType (string)

Feed item subtype classification.

feed.itemType ('actionable' | 'informative')

Whether the item requires user action.

feed.status (string)

Current status of the feed item.

feed.requiresAction (boolean)

True if user action is needed.

feed.createdAt (Date)

When the feed item was created.

groupId (string | null)

Associated group ID if applicable.

Example - Actionable Item Alert:

export async function handler(event, context) {
  // Only process actionable items
  if (!event.feed.requiresAction) {
    return { success: true, skipped: true };
  }
  
  // Send notification
  await mirra.telegram.sendMessage({
    chatId: 'your-chat-id',
    text: `⚡ Action Required\n\n${event.feed.name}\n\n${event.feed.description}`
  });
  
  return { success: true };
}

Example - Feed Logger:

export async function handler(event, context) {
  await mirra.google.sheets.appendRow({
    spreadsheetId: 'feed-log-sheet',
    sheetName: 'Activity',
    values: [
      event.feed.createdAt.toISOString(),
      event.feed.name,
      event.feed.description,
      event.feed.itemType,
      event.feed.requiresAction ? 'Yes' : 'No'
    ]
  });
  
  return { success: true };
}

Subscription Examples:

// All feed items
{
  "eventType": "activity_feed_update"
}
 
// Only actionable items
{
  "eventType": "activity_feed_update",
  "conditions": [
    {
      "field": "feed.requiresAction",
      "operator": "equals",
      "value": true
    }
  ]
}
 
// Specific subtypes
{
  "eventType": "activity_feed_update",
  "conditions": [
    {
      "field": "feed.subType",
      "operator": "equals",
      "value": "payment_reminder"
    }
  ]
}

See Also

On this page