@getnori/feed

中文文档
0.13.0发布于 2026/11/13Apache-2.0TypeScriptESM + CJS近 30 天下载 3882

Nori Feed SDK: a full-screen reel panel for React Native apps, with view tracking for rewards.

原始使用文档
文档目录5 节
  1. Props
  2. Full view on the web: NoriReels
  3. Plain React web apps: NoriReelsWeb
  4. What it reports
  5. Collections

@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

PropDefault
clientrequiredFrom createNoriClient
tagall reelsOnly reels with this tag. Fixes the filter, so no collection chips are shown
collectionstrueShow the All / Tour / Menu / Reviews chips over the reels when the business has reels in more than one collection (see below)
pageSize10Reels per request
mutedfalse
heightparent heightFixed reel height
renderOverlaynoneDrawn over each reel with { reel, active, positionMs, durationMs }; this is where Commerce product cards and Rewards badges go
onReelChangenoneThe visible reel changed
renderEmpty"Nothing here yet."
renderHoldoutnothingHoldout 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>
PropDefault
defaultExpandedtrueStart in full view
expanded / onExpandedChangeuncontrolledControl the view yourself
reducedHeight60% of the window, at least 420Height of the reduced view
renderTopRightnothingDrawn top right, e.g. a PointsBadge
childrennothingDrawn 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.

版本与发布记录

@getnori/feed 共发布 21 个版本,首次发布于 2026/10/21;过去 12 个月发布了 21 个版本。

版本发布日期距今
0.13.0latest2026/11/132 天前
0.12.02026/11/133 天前
0.11.02026/11/133 天前
0.10.12026/11/133 天前
0.10.02026/11/133 天前
0.9.22026/11/115 天前

关于 @getnori/feed 的常见问题

@getnori/feed 是什么?

Nori Feed SDK: a full-screen reel panel for React Native apps, with view tracking for rewards.

如何安装 @getnori/feed?

在项目目录运行 npm install @getnori/feed,或使用 pnpm add / yarn add / bun add。它还需要宿主项目提供 peer 依赖:react(>=18)、react-dom(>=18)、react-native(>=0.74)、react-native-web(>=0.19)、react-native-video(>=6.0.0)。npm 7 及以上与 pnpm 8 及以上默认会自动安装必需的 peer 依赖,Yarn 需要手动安装。

@getnori/feed 支持 TypeScript 吗?

支持。包内自带 TypeScript 类型声明(package.json 声明了 types 入口),安装后即可获得类型提示,无需再安装 @types 包。

@getnori/feed 支持 ESM 还是 CommonJS?

同时提供 ES Module 与 CommonJS 入口,import 和 require() 都可以使用,打包工具会自动选择合适的版本。

@getnori/feed 可以商用吗?

@getnori/feed 使用 Apache-2.0 许可。宽松许可:允许商业使用、修改和再分发,并附带明确的专利授权;分发时需保留许可与 NOTICE 文件,修改过的文件要注明改动。以上为概括,不构成法律意见,请以许可原文为准。

@getnori/feed 的下载量有多少?

根据 npm 官方下载统计,@getnori/feed 在 2026/10/17 – 2026/11/15 这 30 天内被下载 3,882 次,日均约 129 次。下载量会把 CI 构建、镜像同步和作为其他包依赖的安装一并计入,适合横向比较热度,不能直接等同于使用人数。

@getnori/feed 还在维护吗?

最新版本 0.13.0 发布于 2026/11/13(2 天前);至今共发布 21 个版本,其中过去 12 个月发布了 21 个;首次发布于 2026/10/21。发布频率只是参考信号:功能稳定的工具可能很少需要更新,建议结合源码仓库的 issue 和提交记录判断。