Skip to content

docs(wallets): warn against exposing API key and policy ID in frontend - #1817

Merged
jakehobbs merged 5 commits into
mainfrom
jake/docs-signer-api-key
Nov 23, 2026
Merged

jakehobbs merged 5 commits into
mainfrom
jake/docs-signer-api-key

Conversation

@jakehobbs

Copy link
Copy Markdown
Contributor

Description

Several Wallet APIs pages show the Alchemy API key or gas policy ID in client-side code (for example NEXT_PUBLIC_ env vars) with no warning. The Privy React migration page also had a warning that contradicted its own example and recommended origin restrictions, which are easy to bypass outside a browser. This adds consistent warnings and links to existing key security guidance.

Related Issues

None.

Changes Made

  • Add a shared warning snippet (shared/api-key-frontend-warning.mdx) saying client-bundled keys and policy IDs are readable by anyone, and to proxy through a backend in production. It links to the FAQ entry on protecting the key and policy ID, and to Best Practices for Key Security and Management.
  • Include the snippet on the React setup, quickstart and UI customization pages, the Hyperliquid recipe, the Privy/Turnkey/Openfort signer pages and React Native app integration.
  • Rewrite the warning on the Privy React migration page: it now says NEXT_PUBLIC_ values are exposed to the browser and drops the origin-restriction advice.
  • Add a "Security" link to Best Practices for Key Security and Management in the Next steps of the transactions pages (send, batch, sponsor gas, signing, EIP-7702, swap, and others). Four pages without a Next steps section get a new one.

Not changed: the smart-contracts/ and smart-wallets/ pages, the signer apiKey config pages, and the examples themselves, which still use NEXT_PUBLIC_ keys.

Testing

Docs-only change. I have not built the docs or run the validation scripts, and I have not checked that the shared snippet renders or that the FAQ anchor link resolves.

  • I have tested these changes locally
  • I have run the validation scripts (pnpm run validate)
  • I have checked that the documentation builds correctly

🤖 Generated with Claude Code

…d code

Add a shared warning to pages that show the key or policy ID in client code,
and link to key security best practices from transactions Next steps.

Co-Authored-By: Claude Sonnet 5.5 <noreply@anthropic.com>
@github-actions

github-actions Bot commented Nov 23, 2026 •

Copy link
Copy Markdown

🔗 Preview Mode

Name Status Preview Updated (UTC)
Alchemy Docs ✅ Ready 🔗 Visit Preview Nov 23, 2026, 6:21 PM

jakehobbs and others added 4 commits November 23, 2026 10:15
… practices

Co-Authored-By: Claude Sonnet 5.5 <noreply@anthropic.com>
Co-Authored-By: Claude Sonnet 5.5 <noreply@anthropic.com>
Co-Authored-By: Claude Sonnet 5.5 <noreply@anthropic.com>
Co-Authored-By: Claude Sonnet 5.5 <noreply@anthropic.com>
@jakehobbs
jakehobbs marked this pull request as ready for review November 23, 2026 18:20
@chatgpt-codex-connector

chatgpt-codex-connector Bot commented Nov 23, 2026 •

Copy link
Copy Markdown
Codex Review Summary: ✅ Completed

This comment shows the latest Codex review activity on this pull request.

Review Status Commit Review trigger
📝 Code Review ✅ Completed 2026-11-23T18:21:30.359899Z 243e300 Draft marked ready
ℹ️ About Codex in GitHub

Your team has set up Codex to review pull requests in this repo. Reviews are triggered when you

  • Open a pull request for review
  • Mark a draft as ready
  • Comment "@codex review" or "@codex security review".

Codex reacts with 👀 while any review is running, comments if it has suggestions, and reacts with 👍 once all reviews finish with no findings.

@jakehobbs
jakehobbs merged commit df83d44 into main Nov 23, 2026
12 checks passed
@jakehobbs
jakehobbs deleted the jake/docs-signer-api-key branch November 23, 2026 18:31
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