Back
Inapp Inbox Notifications

Marking Notifications As 'Seen' Without Reading The In-App Inbox Notification Feed In Stream-JS


Mark notifications as 'seen' without reading them in the in-app inbox notification feed in Stream.js. Follow these codes to mark your push notifications as seen when the users see them out of app inboxes.

Introduction:

In the realm of app development, swift and efficient notification handling is a key component of user engagement. This article explores a common challenge faced by developers using the stream-js library: marking a notification as “seen” without the need to read the entire notification feed.

Understanding the Challenge:

In scenarios where stream-js is employed, the task of marking a notification feed item as “seen” upon a user’s interaction with a push notification is not straightforward. The hurdle lies in the fact that the addToMany calls, often used for efficiency, do not return the IDs of the added activities. On the contrary, the addActivity method provides the created activity, including the crucial activity ID.

    // Example of addActivity response
const response = {
  actor: 'ken',
  duration: '9.65ms',
  foreign_id: '',
  id: '8b5d69a9-8b73-11e8-98ab-12cb9e7b86a4',
  object: 'some-object',
  origin: null,
  target: '',
  time: '2018-07-19T16:48:21.045496',
  verb: 'add-activity'
};

Identifying Added Activities:

To efficiently manage notifications, obtaining the activity ID is pivotal for subsequent actions.

const activityId = response.id;

Marking Notifications as Seen or Read:

Learn the process of marking a notification feed item as “seen” or “read” using the mark_seen or mark_read options.

    // Example: Marking all items as seen
const feed = client.feed('notification', 'user123');
feed.get({ mark_seen: true });

Working with Activity Group IDs:

Understand the significance of activity group IDs when marking items as seen or read, focusing on the default aggregation format that utilizes the activity ID.

Efficient Solution:

Proposing a streamlined solution for marking a single activity as seen, leveraging the activity ID returned by the addActivity call.

// Example: Marking a specific activity group as seen
const feed = client.feed('notification', 'user123');
feed.get({ mark_seen: true, group: activityId });

Handling addToMany and Efficiency Concerns:

Addressing concerns about using addToMany for populating many feeds and evaluating efficiency against practicality.

Explore InApp Inbox Before Use!

Conclusion:

In conclusion, this article provides a comprehensive guide for developers utilizing stream-js, offering insights into effectively managing notifications and overcoming the challenge of marking activities as “seen” without the need to read the entire feed. Developers are encouraged to choose the approach that best aligns with the specific needs of their application, ensuring a seamless and user-friendly notification experience.

Related articles

Inapp Inbox Notifications

In-App Notification System Design (2026 Guide)

A 2026 system design guide for in-app notifications. Covers architecture, storage schema, WebSocket vs SSE, multi-device sync, preferences, and observability.

Inapp Inbox Notifications

In-App Notification Center for SaaS: Design and Implementation (2026)

Learn how to design and implement an in-app notification center for SaaS. Covers notification types, UX patterns from Slack, GitHub, Linear, and build vs buy tradeoffs.

Inapp Inbox Notifications

React Notification Inbox: In-App Feed for SaaS (2026)

Compare React notification inbox SDKs, learn build vs SDK tradeoffs, and add an in-app notification feed to your SaaS product in minutes with drop-in components.

There’s no better place for you
to build notifications

Join thousands of product & engineering teams using SuprSend to build and ship better notifications—faster.

By clicking “Accept All Cookies”, you agree to the storing of cookies on your device to enhance site navigation, analyze site usage, and assist in our marketing efforts. View our Privacy Policy for more information.