Skip to main content

Notifications Guide

Complete guide to the notification system.

Notification Types

The system supports various notification types:

  • Friend Request: New friend request received
  • Friend Accepted: Friend request accepted
  • Post Reaction: Someone reacted to your post
  • Comment: New comment on your post
  • Message: New message received
  • Mention: You were mentioned in a post/comment
  • Story View: Someone viewed your story

Real-time Notifications

Notifications are delivered in real-time via:

  • WebSocket connections
  • Push notifications (if enabled)
  • Email notifications (optional)

Managing Notifications

Get Notifications

GET /api/notifications?page=1&limit=20&unreadOnly=true

Mark as Read

PUT /api/notifications/{notificationId}/read

Mark All as Read

PUT /api/notifications/read-all

Delete Notification

DELETE /api/notifications/{notificationId}

Notification Preferences

Update Preferences

PUT /api/Notification (or settings endpoints for notification preferences)
{
"friendRequestNotifications": true,
"postReactionNotifications": true,
"commentNotifications": true,
"messageNotifications": true,
"emailNotifications": false,
"pushNotifications": true
}

Push Notifications

Enable Push Notifications

  1. Request browser permission
  2. Subscribe to push service
  3. Save subscription to backend
POST /api/notifications/push/subscribe
{
"endpoint": "https://...",
"keys": {
"p256dh": "...",
"auth": "..."
}
}

Learn More