Portal Community

When to Use

Live Mockup — Info Notification

Security Policy Updated

Our password policy has changed. All accounts now require a minimum of 14 characters and MFA must be enabled. These changes take effect on 2026-06-01.

🔗 View Full Policy

Live Mockup — Warning Notification

Unusual Login Detected

A login from a new location (Singapore) was detected on your account at 2026-05-24 02:14 UTC. If this was you, no action is needed. If not, secure your account immediately.

Secure My Account

Request Payload Schema

interface NotificationPayload {
  /** Main notification message */
  message: string;

  /** Visual severity: 'info' | 'warning' | 'danger' (default: 'info') */
  severity?: 'info' | 'warning' | 'danger';

  /** Optional: link to show as a secondary action */
  actionUrl?: string;

  /** Label for the action link (default: "View Details") */
  actionLabel?: string;
}

Full Request Example

await sendInteraction({
  type: 'notification',
  targetUserId: 'usr_all_employees',   // role-targeting
  title: 'Security Policy Updated',
  payload: {
    message: 'Our password policy has changed. All accounts now require a minimum of 14 characters and MFA must be enabled. Changes take effect 2026-06-01.',
    severity: 'info',
    actionUrl: 'https://intranet.acme.com/policies/password-v4',
    actionLabel: 'View Full Policy'
  },
  timeoutMs: 604_800_000   // 7 days — persists until acknowledged
});

Response Schema

interface NotificationResponse {
  interactionId: string;
  respondedBy:   string;
  outcome:       'acknowledged';
  data: {
    /** ISO 8601 timestamp when the user clicked Acknowledge */
    timestamp: string;
  };
  timestamp: string;
}

Response Example

{
  "interactionId": "int_01HXNOTIF44Z",
  "respondedBy":   "usr_alice",
  "outcome":       "acknowledged",
  "data": {
    "timestamp": "2026-05-25T14:08:33Z"
  },
  "timestamp": "2026-05-25T14:08:33Z"
}

Handling the Response

// You can use useInteractionCallback to track acknowledgement without blocking
import { useInteractionCallback } from 'edge-interact-react';

function PolicyBanner({ interactionId }: { interactionId: string }) {
  const { isAcknowledged, response } = useInteractionCallback(interactionId);

  useEffect(() => {
    if (isAcknowledged) {
      // Record compliance event
      complianceApi.recordAcknowledgement({
        userId: response!.respondedBy,
        policy: 'password-v4',
        at:     response!.data.timestamp
      });
    }
  }, [isAcknowledged]);

  return isAcknowledged ? null : <PolicyBannerUI />;
}

Notification vs. Simple Toast

AspectNotification (EdgeInteract)Toast / Browser Notification
Audit trailFull audit entry with acknowledgement timestampNone
Delivery guaranteeStays in queue until acknowledged or timed outFire-and-forget
Acknowledgement trackingServer records who acknowledged and whenNone
Timeout / escalationCan alert if not acknowledged within windowNot supported
Use caseCompliance, security, mandatory readsStatus updates, non-critical messages
Roles and First-to-Respond When a notification is sent to a role (targetUserId is a role identifier), every member of that role receives the notification individually. Each person must acknowledge it independently — acknowledgement by one user does not dismiss it for others. The audit log records each individual acknowledgement.