In-app UI
Feeds
Overview

Feeds

Power feed-based notification experiences in your product, such as in-app feeds, notification centers, and inboxes.

Overview

The Knock feeds API is great for building notification experiences that rely on a feed of per-user notifications.

Here are a few characteristics of the feeds API.

  • Returns a list of messages generated ahead of time by triggering workflows and scheduling broadcasts.
  • Returns messages in reverse chronological order.
  • Returns aggregate values for unread counts, read counts, and seen counts, for use in feed badge UIs.
  • Can be filtered by status (unread, read, seen, archived) or custom properties.

How Knock powers in-app feeds

How Knock powers in-app messages

In-app feed messages in Knock are generated when a workflow runs for a recipient, or when a broadcast runs. Those in-app messages are available via our client API, which your application uses to fetch messages and update their state (seen, read, interacted with, archived).

In-app messages encode content, which is created using the Knock template editor as part of creating a workflow. You can read more on working with in-app message templates below.

The Knock feed API also provides filtering capabilities to only return messages with a particular status (unread, read, seen etc) or custom property (sent as the data payload in the workflow trigger). You can also sort responses from the Knock feed API by priority, for cases where you only want to display one in-app message to a user at a time. This makes it possible to build highly customized in-app experiences within your product

Clients connect to the in-app real-time service, which receives notifications over a websocket when new messages are sent to an in-app feed channel. This is a managed service provided by Knock.

Pre-built UI feed components

Our client SDKs for React, React Native, iOS, and Android ship with pre-built components to power real-time, in-app notification feeds within your application.

Additionally, our React SDK for the web also ships with prebuilt components to easily integrate Slack and Microsoft Teams authentication and channel selection to power Slack and Microsoft Teams notifications.

Headless Knock

In addition to the pre-built components that we ship, it's also possible to use Knock in a headless way by using our lower-level primitives. Doing so means you get to leverage the full power of Knock's in-app messaging infrastructure while having the flexibility to build your own UI components.

Frequently asked questions

Yes, you can. By default, Knock will create a single in-app channel for you, but you can easily add additional in-app channels should you need to support multiple feeds or different types of in-app message experiences.

Currently you can't pin messages. The feed will only return messages in reverse chronological order with no way to change that order. You can, however, create multiple feed instances and use feed filtering to build a pinned notifications UI.