Barrel export for runtime React contexts used by embeddable OSS-lib components, enforcing a client-only bundle boundary to prevent SSR crashes. ## Key Components | Export | Source | Description | |--------|--------|-------------| | `EndpointsRuntimeContext` | `endpoints-runtime-context` | React context object for endpoints runtime | | `useEndpointsRuntime` | `endpoints-runtime-context` | Hook returning the current endpoints runtime (nullable) | | `useRequiredEndpointsRuntime` | `endpoints-runtime-context` | Hook returning the endpoints runtime, throwing if absent | | `EndpointsRuntime` | `endpoints-runtime-context` | TypeScript type for the endpoints runtime shape | | `ChatRuntimeContext` | `chat-runtime-context` | React context object for chat runtime | | `useChatRuntime` | `chat-runtime-context` | Hook returning the current chat runtime (nullable) | | `useRequiredChatRuntime` | `chat-runtime-context` | Hook returning the chat runtime, throwing if absent | | `ChatRuntime` | `chat-runtime-context` | TypeScript type for the chat runtime shape | | `useOuterOrDefault` | `use-outer-or-default` | Utility hook for resolving outer context or falling back to a default | ## Usage Example ```typescript import { EndpointsRuntimeContext, useRequiredEndpointsRuntime, useChatRuntime, type ChatRuntime, } from '@your-org/oss-lib/contexts' // Provide a runtime at the tree root function AppRoot() { return ( ) } // Consume in a child component (must be a Client Component) function ChatPanel() { const endpoints = useRequiredEndpointsRuntime() // throws if missing const chat: ChatRuntime | null = useChatRuntime() // null-safe // ... } ``` ## Bundle-Split Rules > **Never import from `src/contexts/`** inside server-bundled modules (`utils/index.ts` and its transitive exports). All contexts call `createContext()` at module top-level, which crashes SSR. See `utils/access-code-client.ts` vs `hooks/use-access-code-integration.ts` as the canonical split pattern. | Code type | Goes in | |-----------|---------| | Pure functions with runtime as args | `utils/` | | Hooks that read runtime via `useContext` | `hooks/` (with `'use client'`) | | Context objects / providers | `contexts/` (client bundle only) |