• side project
  • 2024 to 2025
  • npm package
  • Stateless proxy
  • Solo

10xAnswers is a React chat component on npm and the small backend behind it. A site installs the package, passes a persona prompt and a backend URL, and gets a chat that answers questions about the person or product behind it.

I built and published both alone, and the package has 13,113 downloads across 56 releases. Every site on the default URL shares one hosted proxy, so it is stateless by design: the conversation travels with each question, the model key never leaves the server, and nothing is kept between requests.

The 10xAnswers playground: install, customize and see the chat component in action.
npm i 10xanswers
The configurator beside the live widget answering a question with highlighted code.
configure it, ask it
The 10xanswers package page on npm, with its versions and weekly downloads.
on npm
Type
side project
Role
Solo
When
Dec 2024 to May 2025, maintained since
Stack
React, Recoil, Vite, Express, Gemini, Vercel
Links
10x-answers.vercel.appnpm

What I built

  • The component

    A draggable React chat: markdown with highlighted code, questions you can edit and ask again, a skeleton or an error for each answer on its own, themed with about 20 CSS variables.

  • A package that installs cleanly

    ES and UMD builds behind an exports map, React left to the host app, the styles carried inside the bundle, and kept installable as npm changed under it.

    How it works
  • One stateless proxy

    Every site shares it, so it keeps nothing: input checked, prompts capped, the model on a deadline, and a clean status code when something is wrong.

    How it works
  • A playground that writes the code

    A 15-field configurator that turns your choices into the snippet to paste.

  • A TypeScript port

    For Plura AI as plura-chatbot, where I'm the largest contributor.

How it fits together

Your siteany React app<ChatBot />npm i 10xanswersHosted proxyExpress · validatesGeminiflash-lite-latestpersona + URLkey stays heredirect mode, your keyanswers: 200 · 400 · 413 · 429 · 502
One request shape everywhere: the component sends Gemini's own generateContent body, so the same code reaches the hosted proxy, your own backend or Gemini directly. The proxy checks it, caps it, asks the model and forgets it.

One proxy, every site

Every site on the default URL talks to the same function, so it can't hold a conversation without mixing them up. I settled that in the first version: the component keeps the history and sends it inside each question, and the proxy answers and forgets. Two sites never see each other's chats, and any copy of the function can answer any request, so the host can run as many as the traffic needs.

That first version still pushed every question and answer, from every site, onto a global array that nothing ever read: memory that only grew for as long as an instance stayed warm. I deleted it when I came back to harden the proxy.

It speaks Gemini's own request shape, so the component has one code path whether it talks to this proxy, to your own backend or straight to Gemini with your key. I advise against the last: the key then ships to every visitor.

10xAnswers-BE · api/index.js

app.post("/", async (req, res) => {  const prompt = req.body?.contents?.[0]?.parts?.[0]?.text  if (typeof prompt !== "string" || !prompt.trim()) {    return res.status(400).json({ message: /* shape */ })  }  if (prompt.length > MAX_PROMPT_CHARS) {    return res.status(413).json({ message: /* limit */ })  }  try {    // History arrives inside the prompt from the client,    // so this function stays stateless and conversations    // from different sites never mix.    const result = await model.generateContent(prompt)    const text = result.response.text()    res.json({      candidates: [{ content: { parts: [{ text }] } }],    })  } catch (err) {    const status = err?.status === 429 ? 429 : 502    res.status(status).json({ message: /* try again */ })  }})
Stateless on purpose: history travels with each question, so two sites using the same backend never share a conversation.

Failing like an API

In September 2026 the model it called was retired, and every request came back 404; the old proxy answered every failure with a 400 and the upstream's raw error. Now the model is an always-current alias that one environment variable can pin, and the proxy answers like an API: 400 for a malformed body, 413 past 12,000 characters, 429 when the model is rate limited, 502 when it fails. Anything over 64 KB is refused unread.

A week later the alias began thinking before it answered, which alone took short answers past the host's time limit. Thinking is now kept to the minimum, the function may run for 30 s, and the model call gives up at 25 s, so a slow answer ends in a clean error from the proxy instead of the platform's timeout page.

What the proxy costs, measured

I load-tested the proxy as it is, on my laptop, with Gemini's address pointed at a local stub, so what's left is the proxy's own work: parsing and checking the body, building the model request, reading the answer and sending it back. Each question carried the component's default prompt, 1,710 characters.

One question at a time, the proxy adds about 0.2 ms at p50 over calling the stub directly. With the stub taking 500 ms, like a quick model, an answer takes the model's time and very little else, and a prompt over the cap is refused without a model call at all. The proxy is not where this breaks; the shared model quota is, long before.

The proxy with the model stubbed, 30 s a run, median of 3
LoadAnswers a secondp50p95p99
1 connection, the stub alone12,2690.05 ms0.18 ms0.42 ms
1 connection, through the proxy1,6730.27 ms2.18 ms5.87 ms
50 connections, through the proxy3,10112.8 ms32.7 ms65.3 ms
50 connections, the stub taking 500 ms98504 ms539 ms568 ms
50 connections, every prompt over the cap8,5845.1 ms10.7 ms19 ms
On a laptop with other work running, against a stand-in for the model, so these are the proxy's costs, not Gemini's. At 50 connections throughput moved several times over between runs with the laptop's load, so read the medians, not the best run.

A package other apps install

It's built in Vite's library mode as ES and UMD files behind an exports map. React is a peer dependency, the markdown renderer and the rest stay out of the bundle, the CSS is injected by the bundle itself so there is nothing else to import, and the component wraps itself in its own Recoil root, so a site needs no provider.

Each answer is an atom keyed by its own id and its question's text, loaded by an async selector. Editing a question changes the key, so only that answer is fetched again, and each shows its own skeleton or error without touching the rest of the chat.

Keeping it installable is part of the job. In September 2026 I found that a stray dependency named “-” made current npm refuse to install the package at all, and shipped 1.1.17 to fix it. It needs React 18 because Recoil 0.7 does, and the README says so, with the workaround.

0

downloads, all time

56

releases

6,292

last year

1

advisory

The advisory is mine too. Recoil 0.7.7 breaks on React 19 internals, so the readme says so, with the downgrade path.

The npm counter: it counts once, on first sight, then holds.

What breaks first at 10× the traffic

The prompt. The component resends the whole conversation with every question, so a long chat grows until it crosses the prompt cap and gets a 413, and the history sits in one module-level array, so two chats on one page share it. The fix is a budget kept per chat: the last few turns as they were, older ones summarised, counted before sending.

The shared quota. Every site on the default URL draws on one model key, and CORS is open on purpose, so one busy site's 429s become everyone's. Next come a key per site, a token bucket per origin in Redis in front of the model, and answers streamed, so the first words arrive before the whole answer is written.

Next. Version 2: streaming, React 19, provider adapters and a voice mode, as the interface of an agent on this site.

Keyboard shortcuts

Anywhere on the site, while you are not typing.

M
Weather sound on or off
E
Copy my email
T
Day or night
S
Change the season
D
Portfolio
?
These shortcuts
Esc
Close what is open