ReactOverview

React

@junjo/react is the React-specific layer built on top of @junjo/sdk. It wires a single Junjo client through React Context and exposes hooks that consume it.

Install

npm install @junjo/sdk @junjo/react

react is a peer dependency (^18 or ^19); the package brings no React copy of its own.

Hooks and components

Hook / componentDescription
JunjoProviderProvides a Junjo client to the subtree via context.
useJunjoReturns the provided client from any descendant component.
useGroupSnapshot + live event stream for one group’s metadata and active members.
useCanBoolean permission check with a per-provider shared cache.
useMembersPaginated roster with status filter and live event updates.
useInvitationsPaginated invitation list with status filter and live event updates.
useAuditLogPaginated audit log with action filter; refetch-driven (no SSE subscription).
useMutationGeneric mutation primitive with onMutate -> context -> onError rollback hooks for optimistic updates.
applyOptimistic on useMembers / useInvitations / useGroupEach hook’s result returns a snapshot + rollback helper that pairs with useMutation.

Wiring JunjoProvider once at your app’s root is the only setup step you need.