r/reactjs • • Oct 30 '26

Show /r/reactjs I built an open-source React library where an LLM designs the recommendation block and your catalog supplies the prices

This is my own project. rudra-js is an open-source TypeScript library (MIT) for React stores. A language model designs one product-recommendation block, the library checks it against your catalog, and React renders it.

The model never writes HTML or JSX. It returns a few fields: layout, headline, copy, which cards to highlight. Products are SKUs from the list you pass in. Titles, prices, images and links come from your catalog at render, and the model's text is rendered as escaped text. Each field also goes through wording checks, and a field that fails is dropped. They aren't airtight: rewordings and spelled-out numbers can get through.

It works as a Server Component, with renderToString, or client-rendered. Rendered on the server, the block is in the first HTML response with no client JS. React 18 or 19, Node 22.12+.

It also runs with no model, so the quick start needs no API key.

It's v0.8.3 and APIs may change before 1.0. I'd like feedback on the API shape and on what breaks in a real Next.js app.

https://github.com/clivedsouza1010/rudra-js

0 Upvotes

3 comments sorted by

1

u/ltolosa Oct 30 '26

Nobody wants your slop code.

0

u/[deleted] Oct 30 '26

[removed] — view removed comment

1

u/clivedsouza1010 Oct 31 '26

thanks u/gentlesemifinal . yes the wording checks are a weakest part, and i try not to oversell them. I havent implemented it in a real world scenario, but the onEvent will give a list of violations when the checks drop something

if the fields are getting dropped (for eg, if the headline gets dropped) it does not show the entire block. if you try this on your side project, do let me know how it goes and if you find any issues