@base44-preview/sdk 0.8.53-pr.330.92cae72 → 0.8.53-pr.330.ac96a75

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.
@@ -7,8 +7,7 @@ export interface AiGatewayConnection {
7
7
  /**
8
8
  * Bearer token that authenticates the request: the service-role token from
9
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.
10
+ * `base44.aiGateway`. The gateway expects the service-role token.
12
11
  */
13
12
  token: string;
14
13
  /**
@@ -93,21 +92,20 @@ export interface AiGatewayModuleConfig {
93
92
  *
94
93
  * The mode determines which token `connection()` returns:
95
94
  *
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.
95
+ * - **Service role authentication** (`base44.asServiceRole.aiGateway`): Returns the app's service-role token.
96
+ * - **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
97
  *
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.
98
+ * Call the gateway server-side with the app's service role, as every example
99
+ * here does. Calls from the browser or with a user's token are rejected with a
100
+ * `403`, the error code `ai_gateway_requires_service_role`, and the message
101
+ * "AI gateway requests must be made server-side using the app's service role.
102
+ * Calls from the browser or with a user's token are not allowed." Service role
103
+ * also works when there's no signed-in user at all, such as from a scheduled
104
+ * automation.
107
105
  *
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()`.
106
+ * In a backend function, for example, you can check the caller with
107
+ * `base44.auth.me()` before calling the gateway, and call the function from
108
+ * your page with `base44.functions.invoke()`.
111
109
  *
112
110
  * ## Billing and limits
113
111
  *
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.330.ac96a75",
4
4
  "description": "JavaScript SDK for Base44 API",
5
5
  "main": "dist/index.js",
6
6
  "types": "dist/index.d.ts",