SDKs can run in the browser via CORS response headers
The Claude API returns CORS headers, so the official SDKs can be used from a browser by setting dangerouslyAllowBrowser: true at instantiation.
What does this mean for me?
Engineering leadership
Cost, risk, timeline, team impact Worth knowingBrowser calls are now possible but expose whatever API key is used. Make it policy that no organization-owned key ships in client-side code; allow this only for prototypes or user-supplied keys.
Engineer
What to change, what breaks, what to test Worth knowingPass `dangerouslyAllowBrowser: true` at SDK instantiation to call the API from a browser. Only do this with a key the end user owns — anyone can read it in devtools; otherwise keep calls behind your own backend.
General consumer
Using the Claude apps, not the API No impactNothing to do — this is an API-only change and does not affect the Claude apps.
From August 22, 2024 the Claude API returns CORS headers, and the SDKs accept dangerouslyAllowBrowser: true to permit use from browser contexts.
The flag name is the warning: calling the API from a browser exposes the API key to anyone who opens developer tools. It is intended for prototypes and for setups where the key belongs to the end user, not for shipping a key in a web page.
API surface
| Parameter | Change | Breaking | Models |
|---|---|---|---|
dangerouslyAllowBrowser | added | no |