To use this example, you'll need an account on Knock, as well as an in-app feed channel, with a workflow that produces in-app feed messages. You'll also need:
- A public API key for the Knock environment (set as
- The channel ID for the in-app feed (set as
Knock class exposes a
Feed via the
initialize method that can be used to connect the authenticated user to a Knock Feed Channel. Additionally, the
Feed exposes a stateful store to build client-side feeds and other notification experiences.
A feed instance supports marking items as seen, unseen, read, unread, archived, and unarchived:
You can use the JS SDK to retrieve the preferences for the authenticated user, which is useful to build in-app preference UIs.
Similar to retrieving preferences, the
Knock class also allows you to set preferences directly in the client for the authenticated user.