@getnori/feed
A full-screen, vertically paged reel feed for React Native apps. It plays the visible reel, pauses the rest, and reports views so the Nori API can reward viewers.
npm install @getnori/core @getnori/feed react-native-video
import { createNoriClient } from "@getnori/core";
import { NoriFeed } from "@getnori/feed";
const nori = createNoriClient({ publishableKey: "pk_live_...", getViewerToken });
export function IdeasTab() {
return <NoriFeed client={nori} tag="home" />;
}
Props
| Prop | Default | |
|---|---|---|
client | required | From createNoriClient |
tag | all reels | Only reels with this tag. Fixes the filter, so no collection chips are shown |
collections | true | Show the All / Tour / Menu / Reviews chips over the reels when the business has reels in more than one collection (see below) |
pageSize | 10 | Reels per request |
muted | false | |
height | parent height | Fixed reel height |
renderOverlay | none | Drawn over each reel with { reel, active, positionMs, durationMs }; this is where Commerce product cards and Rewards badges go |
onReelChange | none | The visible reel changed |
renderEmpty | "Nothing here yet." | |
renderHoldout | nothing | Holdout viewers (the experiment's control group) get no feed; show your usual content |
Colors come from your tenant theme (background_color, text_color, primary_color).
Full view on the web: NoriReels
On a website the feed usually sits inside the host page, under its header. NoriReels
wraps NoriFeed so reels open in full view, covering the whole window, and a
button (or Escape) drops them to a reduced in-page view and back. Toggling only changes
Full view is drawn in the page body (react-native-web's Modal), so a scroll view or navigator with a CSS transform cannot trap it. Toggling re-mounts the feed, so it reopens at the first reel. While paused it never covers the page.
import { NoriReels } from "@getnori/feed/web";
import { PointsBadge, RewardToasts } from "@getnori/rewards";
<NoriReels client={nori} renderTopRight={() => <PointsBadge client={nori} />}>
<RewardToasts client={nori} />
</NoriReels>
| Prop | Default | |
|---|---|---|
defaultExpanded | true | Start in full view |
expanded / onExpandedChange | uncontrolled | Control the view yourself |
reducedHeight | 60% of the window, at least 420 | Height of the reduced view |
renderTopRight | nothing | Drawn top right, e.g. a PointsBadge |
children | nothing | Drawn over the reel, e.g. RewardToasts |
It also takes every NoriFeed prop except height and style. On iOS and Android the
feed is already a full-screen panel, so NoriReels renders NoriFeed without the toggle.
Plain React web apps: NoriReelsWeb
Vite, Next or any React site without react-native-web: import from @getnori/feed/dom.
It is the same behavior (full view by default, a button or Escape for the reduced view),
written in plain DOM, and it has no react-native dependency. Full view is drawn in the
page body, so a transformed ancestor cannot trap it; toggling re-mounts the feed.
import { NoriReelsWeb } from "@getnori/feed/dom";
<NoriReelsWeb client={nori} renderTopRight={() => <MyPointsBadge />}>
<MyToasts />
</NoriReelsWeb>
It takes tag, pageSize, paused, expanded / defaultExpanded / onExpandedChange,
reducedHeight, renderTopRight, renderOverlay, onReelChange, renderEmpty,
renderHoldout and children, as above. Reels start muted (browsers refuse autoplay
with sound) and the viewer can unmute. It shows the caption, product chips (they link to the
product's deep_link and report product_tap) and the reel's call-to-action link, and
reports the same view events and rewards as the native feed. renderOverlay draws over
each reel in a layer that ignores pointer events; give your own buttons
pointer-events: auto. Pass paused while the feed's route is in the background.
What it reports
For the visible video: impression, view_progress when it starts and at
25/50/75 %, and one view_complete when the viewer reaches your
min_watch_percent. The server decides rewards; listen with
client.on("reward", ...) or use @getnori/rewards. Queued events are sent
when the app goes to the background.
Building your own UI? useFeed(client) pages the feed and createViewTracker
turns playback callbacks into these events.
Collections
A business's reels can belong to a collection: tour (its own tour), menu (one reel per menu item) or reviews (made by viewers). They are ordinary tags, set by the business in Nori Business. When a business has reels in two or more collections, NoriFeed and NoriReelsWeb (and so NoriReels, NoriTab and NoriTabWeb) show All / Tour / Menu / Reviews chips over the reels; one collection shows no chips. There is nothing to configure: an app that upgrades the SDK gets the chips and any later change to them. collections={false} turns them off, and a fixed tag replaces them. client.collections() and the useCollections hook are there for a custom view.