Skip to content

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

Merged
ethanpalm merged 3 commits into
mainfrom
mintlify/c158c0c3
Jun 17, 2026
Merged

docs: clarify API-key safety and add production deployment to assistant-embed tutorial#6201
ethanpalm merged 3 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 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.

@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 17, 2026, 6:09 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.

@mintlify-development

mintlify-development Bot commented Jun 17, 2026

Copy link
Copy Markdown
Contributor

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

Project Status Preview Updated (UTC)
userauth 🟢 Ready View Preview Jun 17, 2026, 6:05 PM

@mintlify-development

mintlify-development Bot commented Jun 17, 2026

Copy link
Copy Markdown
Contributor

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

Project Status Preview Updated (UTC)
prosignuptest 🔴 Failed Jun 17, 2026, 6:17 PM

@mintlify-development

Copy link
Copy Markdown
Contributor

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

Project Status Preview Updated (UTC)
mintlify 🟡 Building Jun 17, 2026, 6:00 PM

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.

2 participants