@base44-preview/sdk 0.8.53-pr.330.92cae72 → 0.8.53-pr.331.bf2d5aa

This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
@@ -5,10 +5,7 @@ export interface AiGatewayConnection {
5
5
  /** Base URL of the selected gateway provider. */
6
6
  baseURL: string;
7
7
  /**
8
- * Bearer token that authenticates the request: the service-role token from
9
- * `base44.asServiceRole.aiGateway`, or the signed-in user's token from
10
- * `base44.aiGateway`. The user token is an empty string when no one is signed
11
- * in, and the gateway rejects that call.
8
+ * Bearer token that authenticates the request. The mode you call `connection()` from determines whose token it is.
12
9
  */
13
10
  token: string;
14
11
  /**
@@ -93,21 +90,14 @@ export interface AiGatewayModuleConfig {
93
90
  *
94
91
  * The mode determines which token `connection()` returns:
95
92
  *
96
- * - **User authentication** (`base44.aiGateway`): Returns the signed-in app user's token.
97
- * - **Service role authentication** (`base44.asServiceRole.aiGateway`): Returns the service-role token instead.
93
+ * - **Service role authentication** (`base44.asServiceRole.aiGateway`): Returns the app's service-role token. Use it server-side. Calls from the browser or with a user's token get a `403` and the error code `ai_gateway_requires_service_role`. It also works when no user is signed in, such as from a scheduled automation.
94
+ * - **User authentication** (`base44.aiGateway`): Returns the signed-in app user's token. The gateway accepts it only on apps shared privately or with your workspace.
98
95
  *
99
- * Use service role from a backend function, as every example here does. The
100
- * gateway accepts a user token only on apps shared privately or with your
101
- * workspace. It rejects anonymous calls, and user-token calls on public apps,
102
- * with a `403` and the error code `ai_gateway_requires_service_role`, so a
103
- * visitor can't spend your app's credits by calling the gateway from the
104
- * browser. A user-token call therefore works while you're building and starts
105
- * failing the moment you share the app publicly. Service role also works when
106
- * there's no signed-in user at all, such as from a scheduled automation.
107
- *
108
- * To control who triggers a billed request, check the caller with
109
- * `base44.auth.me()` in your backend function before calling the gateway, and
110
- * call that function from your page with `base44.functions.invoke()`.
96
+ * The mode decides which token you get and whether the gateway accepts the call.
97
+ * It grants the model no extra reach, because the gateway runs a model and never
98
+ * touches your data. Access to your app's data comes from the `base44.entities`
99
+ * calls you write around the gateway call, so pick the mode for those on their
100
+ * own merits rather than matching this one.
111
101
  *
112
102
  * ## Billing and limits
113
103
  *
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "@base44-preview/sdk",
3
- "version": "0.8.53-pr.330.92cae72",
3
+ "version": "0.8.53-pr.331.bf2d5aa",
4
4
  "description": "JavaScript SDK for Base44 API",
5
5
  "main": "dist/index.js",
6
6
  "types": "dist/index.d.ts",