Skip to content

Commit

Permalink
chore: improve browser error message (#613)
Browse files Browse the repository at this point in the history
  • Loading branch information
stainless-app[bot] authored Nov 18, 2024
1 parent da60f5e commit f148f06
Showing 1 changed file with 1 addition and 1 deletion.
2 changes: 1 addition & 1 deletion src/index.ts
Original file line number Diff line number Diff line change
Expand Up @@ -181,7 +181,7 @@ export class Anthropic extends Core.APIClient {

if (!options.dangerouslyAllowBrowser && Core.isRunningInBrowser()) {
throw new Errors.AnthropicError(
"It looks like you're running in a browser-like environment.\n\nThis is disabled by default, as it risks exposing your secret API credentials to attackers.\nIf you understand the risks and have appropriate mitigations in place,\nyou can set the `dangerouslyAllowBrowser` option to `true`, e.g.,\n\nnew Anthropic({ apiKey, dangerouslyAllowBrowser: true });\n\nTODO: link!\n",
"It looks like you're running in a browser-like environment.\n\nThis is disabled by default, as it risks exposing your secret API credentials to attackers.\nIf you understand the risks and have appropriate mitigations in place,\nyou can set the `dangerouslyAllowBrowser` option to `true`, e.g.,\n\nnew Anthropic({ apiKey, dangerouslyAllowBrowser: true });\n",
);
}

Expand Down

0 comments on commit f148f06

Please sign in to comment.