Provides a lightweight React context (`RichMarkdownRuntimeContext`) that threads proxy endpoint URLs and an optional image-transform function from `` down to its satellite embed clients, without depending on the chat runtime. ## Key Components | Export | Type | Description | |---|---|---| | `RichMarkdownRuntime` | Interface | Defines the three proxy URLs and the `transformImageSrc` knob | | `RichMarkdownRuntimeProvider` | React component | Wraps subtrees with resolved runtime values; memoizes to prevent unnecessary re-renders | | `useRichMarkdownRuntime` | Hook | Reads the ambient runtime; returns hub-matching defaults when called outside any provider | ### `RichMarkdownRuntime` Interface Fields | Field | Default | Description | |---|---|---| | `redditProxyUrl` | `/api/blog/reddit-proxy` | Proxy endpoint for Reddit embeds | | `twitterProxyUrl` | `/api/blog/twitter-proxy` | Proxy endpoint for Twitter/X embeds | | `ogScraperUrl` | `/api/og-scraper` | Endpoint for OG link-preview scraping | | `transformImageSrc` | `() => null` (identity / no rewrite) | Hub-only Supabase image transformer; return `null` to use `src` as-is | ## Usage Example **Hub usage — override the image transformer, inherit proxy defaults:** ```typescript import { RichMarkdownRuntimeProvider } from './rich-markdown-runtime' function BlogLayout({ children }: { children: React.ReactNode }) { return ( supabaseImageTransform(src, opts) } > {children} ) } ``` **Embedder usage — read the runtime inside a satellite client:** ```typescript import { useRichMarkdownRuntime } from './rich-markdown-runtime' function RedditEmbedClient({ postUrl }: { postUrl: string }) { const { redditProxyUrl } = useRichMarkdownRuntime() // Falls back to '/api/blog/reddit-proxy' if no provider is in scope const data = useFetch(`${redditProxyUrl}?url=${postUrl}`) } ``` **Source:** [`rich-markdown-runtime.tsx`](https://github.com/flamingo-stack/openframe-oss-lib/blob/main/rich-markdown-runtime.tsx)