@base44-preview/sdk 0.8.20-pr.136.e0d0374 → 0.8.20-pr.137.2242f71
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.
|
@@ -181,11 +181,11 @@ export interface AuthModule {
|
|
|
181
181
|
* Initiates an OAuth login flow with one of the built-in providers. Requires a browser environment and can't be used in the backend.
|
|
182
182
|
*
|
|
183
183
|
* Supported providers:
|
|
184
|
-
* - `'google'
|
|
185
|
-
* - `'microsoft'
|
|
186
|
-
* - `'facebook'
|
|
187
|
-
* - `'apple'
|
|
188
|
-
* - `'sso'
|
|
184
|
+
* - `'google'` - {@link https://developers.google.com/identity/protocols/oauth2 | Google OAuth}. Enabled by default.
|
|
185
|
+
* - `'microsoft'` - {@link https://learn.microsoft.com/en-us/entra/identity-platform/v2-oauth2-auth-code-flow | Microsoft OAuth}. Enable Microsoft in your app's authentication settings before specifying this provider.
|
|
186
|
+
* - `'facebook'` - {@link https://developers.facebook.com/docs/facebook-login | Facebook Login}. Enable Facebook in your app's authentication settings before using.
|
|
187
|
+
* - `'apple'` - {@link https://developer.apple.com/sign-in-with-apple/ | Sign in with Apple}. Enable Apple in your app's authentication settings before using this provider.
|
|
188
|
+
* - `'sso'` - Enterprise SSO. Enable SSO in your app's authentication settings before using this provider.
|
|
189
189
|
*
|
|
190
190
|
* @param provider - The authentication provider to use: `'google'`, `'microsoft'`, `'facebook'`, `'apple'`, or `'sso'`.
|
|
191
191
|
* @param fromUrl - URL to redirect to after successful authentication. Defaults to `'/'`.
|
|
@@ -213,7 +213,6 @@ export interface AuthModule {
|
|
|
213
213
|
* // SSO
|
|
214
214
|
* base44.auth.loginWithProvider('sso', '/dashboard');
|
|
215
215
|
* ```
|
|
216
|
-
*
|
|
217
216
|
*/
|
|
218
217
|
loginWithProvider(provider: string, fromUrl?: string): void;
|
|
219
218
|
/**
|
|
@@ -24,7 +24,7 @@ export interface ConnectorAccessTokenResponse {
|
|
|
24
24
|
connection_config: Record<string, string> | null;
|
|
25
25
|
}
|
|
26
26
|
/**
|
|
27
|
-
*
|
|
27
|
+
* Camel-cased connection details returned by {@linkcode ConnectorsModule.getConnection | getConnection()}.
|
|
28
28
|
*/
|
|
29
29
|
export interface ConnectorConnectionResponse {
|
|
30
30
|
/** The OAuth access token for the external service. */
|
|
@@ -35,41 +35,13 @@ export interface ConnectorConnectionResponse {
|
|
|
35
35
|
/**
|
|
36
36
|
* Connectors module for managing OAuth tokens for external services.
|
|
37
37
|
*
|
|
38
|
-
* This module allows you to retrieve OAuth access tokens for external services that the app has connected to. Connectors are app-scoped. When an app builder connects an integration like Google Calendar
|
|
38
|
+
* This module allows you to retrieve OAuth access tokens for external services that the app has connected to. Connectors are app-scoped. When an app builder connects an integration like Google Calendar or Slack, all users of the app share that same connection.
|
|
39
39
|
*
|
|
40
40
|
* Unlike the integrations module that provides pre-built functions, connectors give you
|
|
41
41
|
* raw OAuth tokens so you can call external service APIs directly with full control over
|
|
42
42
|
* the API calls you make. This is useful when you need custom API interactions that aren't
|
|
43
43
|
* covered by Base44's pre-built integrations.
|
|
44
44
|
*
|
|
45
|
-
* ## Available connectors
|
|
46
|
-
*
|
|
47
|
-
* All connectors work through [`getConnection()`](#getconnection). Pass the integration type string and use the returned OAuth token to call the external service's API directly.
|
|
48
|
-
*
|
|
49
|
-
* | Service | Type identifier |
|
|
50
|
-
* |---|---|
|
|
51
|
-
* | Discord | `discord` |
|
|
52
|
-
* | GitHub | `github` |
|
|
53
|
-
* | Gmail | `gmail` |
|
|
54
|
-
* | Google BigQuery | `googlebigquery` |
|
|
55
|
-
* | Google Calendar | `googlecalendar` |
|
|
56
|
-
* | Google Docs | `googledocs` |
|
|
57
|
-
* | Google Drive | `googledrive` |
|
|
58
|
-
* | Google Sheets | `googlesheets` |
|
|
59
|
-
* | Google Slides | `googleslides` |
|
|
60
|
-
* | HubSpot | `hubspot` |
|
|
61
|
-
* | LinkedIn | `linkedin` |
|
|
62
|
-
* | Notion | `notion` |
|
|
63
|
-
* | Salesforce | `salesforce` |
|
|
64
|
-
* | Slack User | `slack` |
|
|
65
|
-
* | Slack Bot | `slackbot` |
|
|
66
|
-
* | TikTok | `tiktok` |
|
|
67
|
-
*
|
|
68
|
-
* See the integration guides for more details:
|
|
69
|
-
*
|
|
70
|
-
* - **Scopes and permissions**: {@link https://docs.base44.com/Integrations/gmail-connector#gmail-scopes-and-permissions | Gmail}, {@link https://docs.base44.com/Integrations/linkedin-connector#linkedin-scopes-and-permissions | LinkedIn}, {@link https://docs.base44.com/Integrations/slack-connector#slack-scopes-and-permissions | Slack}
|
|
71
|
-
* - **Slack connector types**: {@link https://docs.base44.com/Integrations/slack-connector#about-the-slack-connectors | About the Slack connectors} explains the difference between `slack` and `slackbot`
|
|
72
|
-
*
|
|
73
45
|
* ## Authentication Modes
|
|
74
46
|
*
|
|
75
47
|
* This module is only available to use with a client in service role authentication mode, which means it can only be used in backend environments.
|
|
@@ -80,15 +52,15 @@ export interface ConnectorConnectionResponse {
|
|
|
80
52
|
*/
|
|
81
53
|
export interface ConnectorsModule {
|
|
82
54
|
/**
|
|
83
|
-
* Retrieves an OAuth access token for a specific
|
|
55
|
+
* Retrieves an OAuth access token for a specific external integration type.
|
|
84
56
|
*
|
|
85
|
-
* @deprecated Use {@link getConnection} instead.
|
|
57
|
+
* @deprecated Use {@link getConnection} and use the returned `accessToken` (and `connectionConfig` when needed) instead.
|
|
86
58
|
*
|
|
87
59
|
* Returns the OAuth token string for an external service that an app builder
|
|
88
60
|
* has connected to. This token represents the connected app builder's account
|
|
89
61
|
* and can be used to make authenticated API calls to that external service on behalf of the app.
|
|
90
62
|
*
|
|
91
|
-
* @param integrationType - The type of integration, such as `'googlecalendar'`, `'slack'`,
|
|
63
|
+
* @param integrationType - The type of integration, such as `'googlecalendar'`, `'slack'`, or `'github'`.
|
|
92
64
|
* @returns Promise resolving to the access token string.
|
|
93
65
|
*
|
|
94
66
|
* @example
|
|
@@ -110,8 +82,8 @@ export interface ConnectorsModule {
|
|
|
110
82
|
*
|
|
111
83
|
* @example
|
|
112
84
|
* ```typescript
|
|
113
|
-
* // Slack
|
|
114
|
-
* // Get Slack
|
|
85
|
+
* // Slack connection
|
|
86
|
+
* // Get Slack OAuth token and list channels
|
|
115
87
|
* const slackToken = await base44.asServiceRole.connectors.getAccessToken('slack');
|
|
116
88
|
*
|
|
117
89
|
* // List all public and private channels
|
|
@@ -123,89 +95,42 @@ export interface ConnectorsModule {
|
|
|
123
95
|
*
|
|
124
96
|
* const data = await slackResponse.json();
|
|
125
97
|
* ```
|
|
126
|
-
*
|
|
127
|
-
* @example
|
|
128
|
-
* ```typescript
|
|
129
|
-
* // Slack Bot connection
|
|
130
|
-
* // Get Slack bot token and post a message with a custom bot identity
|
|
131
|
-
* const botToken = await base44.asServiceRole.connectors.getAccessToken('slackbot');
|
|
132
|
-
*
|
|
133
|
-
* const response = await fetch('https://slack.com/api/chat.postMessage', {
|
|
134
|
-
* method: 'POST',
|
|
135
|
-
* headers: {
|
|
136
|
-
* 'Authorization': `Bearer ${botToken}`,
|
|
137
|
-
* 'Content-Type': 'application/json'
|
|
138
|
-
* },
|
|
139
|
-
* body: JSON.stringify({
|
|
140
|
-
* channel: '#alerts',
|
|
141
|
-
* text: 'Deployment to production completed successfully.',
|
|
142
|
-
* username: 'Deploy Bot',
|
|
143
|
-
* icon_emoji: ':rocket:'
|
|
144
|
-
* })
|
|
145
|
-
* });
|
|
146
|
-
*
|
|
147
|
-
* const result = await response.json();
|
|
148
|
-
* ```
|
|
149
98
|
*/
|
|
150
99
|
getAccessToken(integrationType: ConnectorIntegrationType): Promise<string>;
|
|
151
100
|
/**
|
|
152
101
|
* Retrieves the OAuth access token and connection configuration for a specific external integration type.
|
|
153
102
|
*
|
|
154
103
|
* Returns both the OAuth token and any additional connection configuration
|
|
155
|
-
* that the connector provides.
|
|
156
|
-
* parameters
|
|
157
|
-
* subdomain to construct the API URL (`{subdomain}.example.com`), which
|
|
158
|
-
* is available in `connectionConfig`. Most connectors only need the
|
|
159
|
-
* `accessToken`; `connectionConfig` will be `null` when there are no
|
|
160
|
-
* extra parameters.
|
|
104
|
+
* that the connector provides. This is useful when the external service requires
|
|
105
|
+
* extra parameters beyond the access token (e.g., a shop domain, account ID, or API base URL).
|
|
161
106
|
*
|
|
162
107
|
* @param integrationType - The type of integration, such as `'googlecalendar'`, `'slack'`, or `'github'`.
|
|
163
108
|
* @returns Promise resolving to a {@link ConnectorConnectionResponse} with `accessToken` and `connectionConfig`.
|
|
164
109
|
*
|
|
165
110
|
* @example
|
|
166
111
|
* ```typescript
|
|
167
|
-
* //
|
|
168
|
-
*
|
|
169
|
-
*
|
|
170
|
-
*
|
|
171
|
-
* const timeMin = new Date().toISOString();
|
|
172
|
-
* const url = `https://www.googleapis.com/calendar/v3/calendars/primary/events?maxResults=10&orderBy=startTime&singleEvents=true&timeMin=${timeMin}`;
|
|
173
|
-
*
|
|
174
|
-
* const calendarResponse = await fetch(url, {
|
|
175
|
-
* headers: { Authorization: `Bearer ${accessToken}` }
|
|
176
|
-
* });
|
|
177
|
-
*
|
|
178
|
-
* const events = await calendarResponse.json();
|
|
112
|
+
* // Basic usage
|
|
113
|
+
* const connection = await base44.asServiceRole.connectors.getConnection('googlecalendar');
|
|
114
|
+
* console.log(connection.accessToken);
|
|
115
|
+
* console.log(connection.connectionConfig);
|
|
179
116
|
* ```
|
|
180
117
|
*
|
|
181
118
|
* @example
|
|
182
119
|
* ```typescript
|
|
183
|
-
* //
|
|
184
|
-
*
|
|
185
|
-
* const { accessToken } =
|
|
186
|
-
*
|
|
187
|
-
*
|
|
188
|
-
*
|
|
189
|
-
*
|
|
190
|
-
*
|
|
191
|
-
*
|
|
192
|
-
*
|
|
193
|
-
*
|
|
194
|
-
*
|
|
195
|
-
*
|
|
196
|
-
*
|
|
197
|
-
* ```typescript
|
|
198
|
-
* // Using connectionConfig
|
|
199
|
-
* // Some connectors return a subdomain or other params needed to build the API URL
|
|
200
|
-
* const { accessToken, connectionConfig } = await base44.asServiceRole.connectors.getConnection('myservice');
|
|
201
|
-
*
|
|
202
|
-
* const subdomain = connectionConfig?.subdomain;
|
|
203
|
-
* const response = await fetch(
|
|
204
|
-
* `https://${subdomain}.example.com/api/v1/resources`,
|
|
205
|
-
* { headers: { Authorization: `Bearer ${accessToken}` } }
|
|
206
|
-
* );
|
|
207
|
-
*
|
|
208
|
-
* const data = await response.json();
|
|
120
|
+
* // Shopify: connectionConfig has subdomain (e.g. "my-store" for my-store.myshopify.com)
|
|
121
|
+
* const connection = await base44.asServiceRole.connectors.getConnection('shopify');
|
|
122
|
+
* const { accessToken, connectionConfig } = connection;
|
|
123
|
+
* const shop = connectionConfig?.subdomain
|
|
124
|
+
* ? `https://${connectionConfig.subdomain}.myshopify.com`
|
|
125
|
+
* : null;
|
|
126
|
+
*
|
|
127
|
+
* if (shop) {
|
|
128
|
+
* const response = await fetch(
|
|
129
|
+
* `${shop}/admin/api/2024-01/products.json?limit=10`,
|
|
130
|
+
* { headers: { 'X-Shopify-Access-Token': accessToken } }
|
|
131
|
+
* );
|
|
132
|
+
* const { products } = await response.json();
|
|
133
|
+
* }
|
|
209
134
|
* ```
|
|
210
135
|
*/
|
|
211
136
|
getConnection(integrationType: ConnectorIntegrationType): Promise<ConnectorConnectionResponse>;
|
|
@@ -19,7 +19,7 @@ export type IntegrationEndpointFunction = (data: Record<string, any>) => Promise
|
|
|
19
19
|
* ```typescript
|
|
20
20
|
* await base44.integrations.Core.InvokeLLM({
|
|
21
21
|
* prompt: 'Explain quantum computing',
|
|
22
|
-
* model: '
|
|
22
|
+
* model: 'gpt_5'
|
|
23
23
|
* });
|
|
24
24
|
* ```
|
|
25
25
|
*
|
|
@@ -41,6 +41,11 @@ export type IntegrationPackage = {
|
|
|
41
41
|
export interface InvokeLLMParams {
|
|
42
42
|
/** The prompt text to send to the model */
|
|
43
43
|
prompt: string;
|
|
44
|
+
/** Optionally specify a model to override the app-level model setting for this specific call.
|
|
45
|
+
*
|
|
46
|
+
* Options: `"gpt_5_mini"`, `"gemini_3_flash"`, `"gpt_5"`, `"gemini_3_pro"`, `"claude_sonnet_4_6"`, `"claude_opus_4_6"`
|
|
47
|
+
*/
|
|
48
|
+
model?: 'gpt_5_mini' | 'gemini_3_flash' | 'gpt_5' | 'gemini_3_pro' | 'claude_sonnet_4_6' | 'claude_opus_4_6';
|
|
44
49
|
/** If set to `true`, the LLM will use Google Search, Maps, and News to gather real-time context before answering.
|
|
45
50
|
* @default false
|
|
46
51
|
*/
|
|
@@ -362,7 +367,7 @@ export type IntegrationsModule = {
|
|
|
362
367
|
* ```typescript
|
|
363
368
|
* const response = await base44.integrations.Core.InvokeLLM({
|
|
364
369
|
* prompt: 'Explain quantum computing',
|
|
365
|
-
* model: '
|
|
370
|
+
* model: 'gpt_5'
|
|
366
371
|
* });
|
|
367
372
|
* ```
|
|
368
373
|
*/
|
|
@@ -391,7 +396,7 @@ export type IntegrationsModule = {
|
|
|
391
396
|
* ```typescript
|
|
392
397
|
* const response = await base44.integrations.Core.InvokeLLM({
|
|
393
398
|
* prompt: 'Explain quantum computing',
|
|
394
|
-
* model: '
|
|
399
|
+
* model: 'gpt_5'
|
|
395
400
|
* });
|
|
396
401
|
* ```
|
|
397
402
|
*
|