npm package discovery and stats viewer.

Discover Tips

  • General search

    [free text search, go nuts!]

  • Package details

    pkg:[package-name]

  • User packages

    @[username]

Sponsor

Optimize Toolset

I’ve always been into building performant and accessible sites, but lately I’ve been taking it extremely seriously. So much so that I’ve been building a tool to help me optimize and monitor the sites that I build to make sure that I’m making an attempt to offer the best experience to those who visit them. If you’re into performant, accessible and SEO friendly sites, you might like it too! You can check it out at Optimize Toolset.

About

Hi, 👋, I’m Ryan Hefner  and I built this site for me, and you! The goal of this site was to provide an easy way for me to check the stats on my npm packages, both for prioritizing issues and updates, and to give me a little kick in the pants to keep up on stuff.

As I was building it, I realized that I was actually using the tool to build the tool, and figured I might as well put this out there and hopefully others will find it to be a fast and useful way to search and browse npm packages as I have.

If you’re interested in other things I’m working on, follow me on Twitter or check out the open source projects I’ve been publishing on GitHub.

I am also working on a Twitter bot for this site to tweet the most popular, newest, random packages from npm. Please follow that account now and it will start sending out packages soon–ish.

Open Software & Tools

This site wouldn’t be possible without the immense generosity and tireless efforts from the people who make contributions to the world and share their work via open source initiatives. Thank you 🙏

© 2026 – Pkg Stats / Ryan Hefner

@noverachat/sdk-react

v0.7.0

Published

React hooks/bindings for NoveraChat — @noverachat/sdk-web 위에 얹는 얇은 래퍼

Downloads

113

Readme

@noverachat/sdk-react

🇰🇷 한국어

React hooks/bindings for NoveraChat — a thin layer over @noverachat/sdk-web (the headless NoveraChat / Room core). It does NOT reimplement chat logic and it does NOT ship chat UI — this package is only the glue: a lifecycle-managed provider and hooks that turn the SDK's events into React state.

Tip: inject a cacheStore in the client options and useMessages renders the last known history instantly on cold start (snapshot cache) — zero screen-code changes.

Install

npm i @noverachat/sdk-react @noverachat/sdk-web react

react >= 18 is a peer dependency (uses useSyncExternalStore).

Quick start

import {
  NoveraChatProvider,
  useMessages,
  useTyping,
} from "@noverachat/sdk-react";

function App() {
  return (
    <NoveraChatProvider
      options={{
        appId: "app_9f8k2x",
        endpoint: "https://chat.example.com",
        tokenProvider: async () => fetchJwt(),
      }}
    >
      <ChatScreen roomId="room_123" />
    </NoveraChatProvider>
  );
}

function ChatScreen({ roomId }: { roomId: string }) {
  const { messages, hasMore, store } = useMessages(roomId);
  const { isAnyoneTyping, setTyping } = useTyping(roomId);

  return (
    <>
      {hasMore && <button onClick={() => store.loadMore()}>older…</button>}
      {messages.map((m) => (
        <div key={m.id}>
          {m.isDeleted ? "(deleted)" : m.content}
          {m.status === "sending" && " ⏳"}
          {m.status === "failed" && " ⚠️"}
        </div>
      ))}
      {isAnyoneTyping && <span>typing…</span>}
      <input
        onChange={() => setTyping(true)}
        onKeyDown={(e) => {
          if (e.key !== "Enter") return;
          store.send(e.currentTarget.value);
          e.currentTarget.value = "";
        }}
      />
    </>
  );
}

API

| Export | What it is | |---|---| | NoveraChatProvider / useNoveraChat() | Creates a NoveraChat, runs connect()/disconnect() over the mount lifecycle; the hook reads it anywhere below. Options are read once — remount with a new key to reconnect differently. | | useRoom(roomId) | The Room facade, for direct SDK calls the hooks don't cover (members, announcements, invites, moderation, …). | | useMessages(roomId, opts?) | Live message list (ChatMessage[], oldest first) + hasMore + readWatermarks, plus the backing RoomStore for actions: send, sendFile (with upload progress), edit, delete, toggleReaction, markRead, loadMore, search, isReadBy, readCount. Sends are optimistic — a sending bubble flips to sent on ack or failed on error. | | useTyping(roomId, opts?) | Who's typing (auto-expires after timeoutMs, default 5s) + setTyping to broadcast your own state. | | useUnread(opts?) | Account-wide unread badge: total, per-room summary, refresh(), optional refreshIntervalMs polling. | | useRoomList(opts?) | Live chat-room list (채팅 탭): previews, unread badges, most-recent-first ordering. New messages bump rooms to the top; membership events trigger a debounced reload. Actions: markRead, hideRoom, unhideRoom. | | useMemberList(roomId) | Live member list — roles, operators, activeMemberIds (for read-receipt math), presence dots updated in place. | | useRoomFiles(roomId, opts?) | Paginated media/file grid (파일함·앨범), newest first: items, media (images/videos only), hasMore, store.loadMore() / store.refresh(). | | useRoomSettings(roomId) | Room-settings actions: setMuted / setPushTrigger, invite-link CRUD, join-request inbox (approve/reject), leave / clearHistory / deleteMyMessages, operator moderation (freeze, setPublic, muteMember, …). | | ChatMessage | Uniform view model over history (REST), live (WS) and optimistic messages. | | RoomStore | The framework-agnostic store behind useMessages, usable outside hooks (tests, non-React glue). |

Everything from @noverachat/sdk-web is re-exported, so a single import gets you NoveraChat, Room, message/event types, etc.

Documentation

React-specific guides are on the NoveraChat docs site (source under docs/) — start with build a chat screen.

| Section | Contents | |---|---| | Getting started | Install + wire a chat screen | | Guides | State & lifecycle · chat-room list · read receipts · files & media · room settings screen | | Reference | Hooks & stores API |

Chat behavior — auth, connection, messaging, rooms, push, errors — is documented in @noverachat/sdk-web, not duplicated here.

Notes

  • The read watermark (markRead) is debounced inside the core SDK; the store flushes it automatically when the tab is hidden/closed and on unmount, so unread counts stay correct across devices.
  • StrictMode-safe: subscriptions attach/detach cleanly across the simulated double mount, and the initial history load is guarded against duplication.