You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
Reader-question audit of guides/assistant-embed.mdx surfaced a misleading API-key safety note and a missing production-deployment path.
Changes
guides/assistant-embed.mdx
Gap: page told readers the assistant API key is "a public token that you can use in frontend code," contradicting the canonical guidance in api/introduction.mdx ("Do not directly embed the assistant API key in client-side code"). A reader asking "is it safe to expose this key in my frontend?" got an unsafe answer.
Fix: replaced the <Note> with a <Warning> that explains the local-vs-production distinction and links to the new production-deployment section.
Gap: tutorial ended without telling readers how to ship the widget safely. A reader asking "how do I deploy this without leaking my key?" had no answer.
Fix: added a ### Production deployment subsection covering moving the key to a server-side env var, adding a backend proxy route, streaming the response (and X-Thread-Id / X-Thread-Key headers) back to the widget, and pointing the widget's api option at the proxy.
Note
Low Risk
Documentation-only changes with no runtime or API behavior impact; improves security guidance alignment across locales.
Overview
The assistant-embed tutorial (guides/assistant-embed.mdx plus Spanish and French locales) no longer tells readers the assistant API key is safe as a public frontend token. That <Note> is replaced with a <Warning> that matches api/introduction.mdx: local dev with the tutorial key is OK, but production must not ship the key in client code because of credit theft and overages, with a link to the new deployment section.
A Production deployment subsection was added before the keyboard-shortcuts content. It explains moving the key off VITE_ client env vars, proxying via a backend route with Authorization, pass-through streaming (including X-Thread-Id / X-Thread-Key), and pointing the widget api at the proxy for rate limiting and auth.
Reviewed by Cursor Bugbot for commit c4da1e7. Bugbot is set up for automated code reviews on this repo. Configure here.
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Add this suggestion to a batch that can be applied as a single commit.This suggestion is invalid because no changes were made to the code.Suggestions cannot be applied while the pull request is closed.Suggestions cannot be applied while viewing a subset of changes.Only one suggestion per line can be applied in a batch.Add this suggestion to a batch that can be applied as a single commit.Applying suggestions on deleted lines is not supported.You must change the existing code in this line in order to create a valid suggestion.Outdated suggestions cannot be applied.This suggestion has been applied or marked resolved.Suggestions cannot be applied from pending reviews.Suggestions cannot be applied on multi-line comments.Suggestions cannot be applied while the pull request is queued to merge.Suggestion cannot be applied right now. Please check back later.
Summary
Reader-question audit of
guides/assistant-embed.mdxsurfaced a misleading API-key safety note and a missing production-deployment path.Changes
guides/assistant-embed.mdxapi/introduction.mdx("Do not directly embed the assistant API key in client-side code"). A reader asking "is it safe to expose this key in my frontend?" got an unsafe answer.<Note>with a<Warning>that explains the local-vs-production distinction and links to the new production-deployment section.### Production deploymentsubsection covering moving the key to a server-side env var, adding a backend proxy route, streaming the response (andX-Thread-Id/X-Thread-Keyheaders) back to the widget, and pointing the widget'sapioption at the proxy.Note
Low Risk
Documentation-only changes with no runtime or API behavior impact; improves security guidance alignment across locales.
Overview
The assistant-embed tutorial (
guides/assistant-embed.mdxplus Spanish and French locales) no longer tells readers the assistant API key is safe as a public frontend token. That<Note>is replaced with a<Warning>that matchesapi/introduction.mdx: local dev with the tutorial key is OK, but production must not ship the key in client code because of credit theft and overages, with a link to the new deployment section.A
Production deploymentsubsection was added before the keyboard-shortcuts content. It explains moving the key offVITE_client env vars, proxying via a backend route withAuthorization, pass-through streaming (includingX-Thread-Id/X-Thread-Key), and pointing the widgetapiat the proxy for rate limiting and auth.Reviewed by Cursor Bugbot for commit c4da1e7. Bugbot is set up for automated code reviews on this repo. Configure here.