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 to a tutorial; no runtime or security-sensitive code in this repo.
Overview
Updates the assistant embed tutorial so readers no longer put the assistant API key in client code.
The API key note now states the key stays server-side via a backend proxy. The setup step is renamed to Set up your API key, uses MINTLIFY_TOKEN instead of VITE_MINTLIFY_TOKEN, and adds steps for an /api/assistant proxy (Bearer auth, streaming, thread headers). The thread tracking example points useChat at /api/assistant and drops client Authorization headers.
Reviewed by Cursor Bugbot for commit 2cbf1ce. 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 to a tutorial; no runtime or security-sensitive code in this repo.
Overview
Updates the assistant embed tutorial so readers no longer put the assistant API key in client code.
The API key note now states the key stays server-side via a backend proxy. The setup step is renamed to Set up your API key, uses
MINTLIFY_TOKENinstead ofVITE_MINTLIFY_TOKEN, and adds steps for an/api/assistantproxy (Bearer auth, streaming, thread headers). The thread tracking example pointsuseChatat/api/assistantand drops clientAuthorizationheaders.Reviewed by Cursor Bugbot for commit 2cbf1ce. Bugbot is set up for automated code reviews on this repo. Configure here.