Skip to content

docs: clarify API-key safety and add production deployment to assistant-embed tutorial#6201

Open
mintlify[bot] wants to merge 2 commits into
mainfrom
mintlify/c158c0c3
Open

docs: clarify API-key safety and add production deployment to assistant-embed tutorial#6201
mintlify[bot] wants to merge 2 commits into
mainfrom
mintlify/c158c0c3

Conversation

@mintlify

@mintlify mintlify Bot commented Jun 16, 2026

Copy link
Copy Markdown
Contributor

Summary

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.

@mintlify

mintlify Bot commented Jun 16, 2026

Copy link
Copy Markdown
Contributor Author

Preview deployment for your docs. Learn more about Mintlify Previews.

Project Status Preview Updated (UTC)
mintlify 🟢 Ready View Preview Jun 16, 2026, 11:35 PM

@mintlify

mintlify Bot commented Jun 16, 2026

Copy link
Copy Markdown
Contributor Author

Preview deployment for your docs. Learn more about Mintlify Previews.

Project Status Preview Updated (UTC)
smartac 🟢 Ready View Preview Jun 16, 2026, 11:36 PM

💡 Tip: Enable Workflows to automatically generate PRs for you.

@mintlify

mintlify Bot commented Jun 16, 2026

Copy link
Copy Markdown
Contributor Author

Preview deployment for your docs. Learn more about Mintlify Previews.

Project Status Preview Updated (UTC)
testsignup415 🟢 Ready View Preview Jun 16, 2026, 11:36 PM

💡 Tip: Enable Workflows to automatically generate PRs for you.

@mintlify

mintlify Bot commented Jun 16, 2026

Copy link
Copy Markdown
Contributor Author

Preview deployment for your docs. Learn more about Mintlify Previews.

Project Status Preview Updated (UTC)
adminroletesting 🟢 Ready View Preview Jun 16, 2026, 11:37 PM

💡 Tip: Enable Workflows to automatically generate PRs for you.

@mintlify

mintlify Bot commented Jun 16, 2026

Copy link
Copy Markdown
Contributor Author

Preview deployment for your docs. Learn more about Mintlify Previews.

Project Status Preview Updated (UTC)
hfh-d7a4d643 🟢 Ready View Preview Jun 16, 2026, 11:37 PM

💡 Tip: Enable Workflows to automatically generate PRs for you.

@mintlify

mintlify Bot commented Jun 16, 2026

Copy link
Copy Markdown
Contributor Author

Preview deployment for your docs. Learn more about Mintlify Previews.

Project Status Preview Updated (UTC)
gwgwgw 🟢 Ready View Preview Jun 16, 2026, 11:38 PM

💡 Tip: Enable Workflows to automatically generate PRs for you.

@mintlify

mintlify Bot commented Jun 16, 2026

Copy link
Copy Markdown
Contributor Author

Preview deployment for your docs. Learn more about Mintlify Previews.

Project Status Preview Updated (UTC)
tomee 🟢 Ready View Preview Jun 16, 2026, 11:39 PM

💡 Tip: Enable Workflows to automatically generate PRs for you.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

1 participant