-
Notifications
You must be signed in to change notification settings - Fork 16
feat(KNO-11394): initialize feed clients in compact mode by default #851
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
Merged
mattmikolay
merged 18 commits into
main
from
mattmik-kno-11394-support-compact-mode-for-feeds
Feb 10, 2026
Merged
Changes from 12 commits
Commits
Show all changes
18 commits
Select commit
Hold shift + click to select a range
0947e69
Add mode and exclude to FeedClientOptions
mattmikolay dc3c347
Update tests
mattmikolay 14a98d9
Add changeset
mattmikolay 1d15435
Remove exclude
mattmikolay dbaf175
Update feedClientDefaults
mattmikolay a16267a
Add comments to types
mattmikolay f7c5d46
Fix failing tests
mattmikolay b1e6054
Update tests
mattmikolay 7dff37e
Fix useNotifications test
mattmikolay 4980591
Make activities and total_activities optional
mattmikolay e6014f4
Update changeset
mattmikolay db04746
Update changeset
mattmikolay 08727a6
Merge branch 'main' into mattmik-kno-11394-support-compact-mode-for-f…
mattmikolay a9848fb
Remove duplicate test
mattmikolay 39a5259
Update changeset
mattmikolay 7938bff
Update changeset
mattmikolay 2d3a526
Fix code snippets in changeset
mattmikolay 87c4b43
Update jsdoc for mode option
mattmikolay File filter
Filter by extension
Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
There are no files selected for viewing
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
| Original file line number | Diff line number | Diff line change |
|---|---|---|
| @@ -0,0 +1,41 @@ | ||
| --- | ||
| "@knocklabs/client": minor | ||
| "@knocklabs/react-core": minor | ||
| "@knocklabs/expo": minor | ||
| "@knocklabs/react": minor | ||
| "@knocklabs/react-native": minor | ||
| --- | ||
|
|
||
| Initialize feeds in `"compact"` mode by default | ||
|
|
||
| The feed client can now be initialized with a `mode` option, set to either `"compact"` or `"rich"`. When `mode` is `"compact"`, the `activities` and `total_activities` fields will _not_ be present on feed items, and the `data` field will not include nested arrays and objects. | ||
|
|
||
| **By default, feeds are initialized in `"compact"` mode. If you need to access `activities`, `total_activities`, or the complete `data`, you must initialize your feed in `"rich"` mode.** | ||
|
|
||
| If you are using the feed client via `@knocklabs/client` directly: | ||
|
|
||
| ```js | ||
| const knockFeed = knockClient.feeds.initialize( | ||
| process.env.KNOCK_FEED_CHANNEL_ID, | ||
| { mode: "full" }, | ||
| ); | ||
| ``` | ||
|
|
||
| If you are using `<KnockFeedProvider>` via `@knocklabs/react`, `@knocklabs/react-native`, or `@knocklabs/expo`: | ||
|
|
||
| ```tsx | ||
| <KnockFeedProvider | ||
| feedId={process.env.KNOCK_FEED_CHANNEL_ID} | ||
| defaultFeedOptions={{ mode: "full" }} | ||
| /> | ||
| ``` | ||
|
|
||
| If you are using the `useNotifications` hook via `@knocklabs/react-core`: | ||
|
|
||
| ```js | ||
| const feedClient = useNotifications( | ||
| knockClient, | ||
| process.env.KNOCK_FEED_CHANNEL_ID, | ||
| { mode: "full" }, | ||
| ); | ||
| ``` | ||
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Oops, something went wrong.
Add this suggestion to a batch that can be applied as a single commit.
This suggestion is invalid because no changes were made to the code.
Suggestions cannot be applied while the pull request is closed.
Suggestions cannot be applied while viewing a subset of changes.
Only one suggestion per line can be applied in a batch.
Add this suggestion to a batch that can be applied as a single commit.
Applying suggestions on deleted lines is not supported.
You must change the existing code in this line in order to create a valid suggestion.
Outdated suggestions cannot be applied.
This suggestion has been applied or marked resolved.
Suggestions cannot be applied from pending reviews.
Suggestions cannot be applied on multi-line comments.
Suggestions cannot be applied while the pull request is queued to merge.
Suggestion cannot be applied right now. Please check back later.
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Sounds like there may be a potential breakage if you upgrade without any code change?
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Correct. As per Chris’s comment here: