Skip to content

Commit

Permalink
chore(docs): update browser support information (#1045)
Browse files Browse the repository at this point in the history
  • Loading branch information
stainless-app[bot] committed Sep 6, 2024
1 parent 7e04428 commit 315ca6b
Showing 1 changed file with 8 additions and 2 deletions.
10 changes: 8 additions & 2 deletions README.md
Original file line number Diff line number Diff line change
Expand Up @@ -618,16 +618,22 @@ The following runtimes are supported:
- Jest 28 or greater with the `"node"` environment (`"jsdom"` is not supported at this time).
- Nitro v2.6 or greater.
- Web browsers: disabled by default to avoid exposing your secret API credentials. Enable browser support by explicitly setting `dangerouslyAllowBrowser` to true'.
<details>
<summary>More explanation</summary>
<details>
<summary>More explanation</summary>

### Why is this dangerous?

Enabling the `dangerouslyAllowBrowser` option can be dangerous because it exposes your secret API credentials in the client-side code. Web browsers are inherently less secure than server environments,
any user with access to the browser can potentially inspect, extract, and misuse these credentials. This could lead to unauthorized access using your credentials and potentially compromise sensitive data or functionality.

### When might this not be dangerous?

In certain scenarios where enabling browser support might not pose significant risks:

- Internal Tools: If the application is used solely within a controlled internal environment where the users are trusted, the risk of credential exposure can be mitigated.
- Public APIs with Limited Scope: If your API has very limited scope and the exposed credentials do not grant access to sensitive data or critical operations, the potential impact of exposure is reduced.
- Development or debugging purpose: Enabling this feature temporarily might be acceptable, provided the credentials are short-lived, aren't also used in production environments, or are frequently rotated.

</details>

Note that React Native is not supported at this time.
Expand Down

0 comments on commit 315ca6b

Please sign in to comment.