@base44-preview/sdk 0.8.19-pr.135.d9d067f → 0.8.20-pr.136.f19f6e0

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,13 +181,12 @@ 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'` - {@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.
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.
189
188
  *
190
- * @param provider - The authentication provider to use: `'google'`, `'microsoft'`, `'facebook'`, `'apple'`, or `'sso'`.
189
+ * @param provider - The authentication provider to use: `'google'`, `'microsoft'`, `'facebook'`, or `'apple'`.
191
190
  * @param fromUrl - URL to redirect to after successful authentication. Defaults to `'/'`.
192
191
  *
193
192
  * @example
@@ -208,11 +207,6 @@ export interface AuthModule {
208
207
  * base44.auth.loginWithProvider('apple', '/dashboard');
209
208
  * ```
210
209
  *
211
- * @example
212
- * ```typescript
213
- * // SSO
214
- * base44.auth.loginWithProvider('sso', '/dashboard');
215
- * ```
216
210
  */
217
211
  loginWithProvider(provider: string, fromUrl?: string): void;
218
212
  /**
@@ -14,7 +14,6 @@ export function createConnectorsModule(axios, appId) {
14
14
  */
15
15
  // @ts-expect-error Return type mismatch with interface - implementation returns string, interface expects string but implementation is typed as ConnectorAccessTokenResponse
16
16
  async getAccessToken(integrationType) {
17
- console.warn("[Base44 SDK] connectors.getAccessToken() is deprecated. Use getConnection(integrationType) and use the returned accessToken instead.");
18
17
  if (!integrationType || typeof integrationType !== "string") {
19
18
  throw new Error("Integration type is required and must be a string");
20
19
  }
@@ -35,13 +35,43 @@ 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 or Slack, all users of the app share that same connection.
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, Slack, or GitHub, 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 [`getAccessToken()`](#getaccesstoken). 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
+ * ### Slack User vs Slack Bot
69
+ *
70
+ * Base44 provides two separate Slack connectors with different OAuth flows:
71
+ *
72
+ * - **`slack`** (Slack User): Uses a user token. API calls act as the connected Slack user. Requests user-level scopes such as reading conversations and searching message history. Some organizations restrict user-scope Slack apps.
73
+ * - **`slackbot`** (Slack Bot): Uses a bot token. API calls act as a bot with a customizable display name and icon. Requests bot-level scopes, which are more commonly allowed by organizations with stricter security policies. The bot can post to public channels without being invited and supports custom branding per message.
74
+ *
45
75
  * ## Authentication Modes
46
76
  *
47
77
  * 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.
@@ -60,7 +90,7 @@ export interface ConnectorsModule {
60
90
  * has connected to. This token represents the connected app builder's account
61
91
  * and can be used to make authenticated API calls to that external service on behalf of the app.
62
92
  *
63
- * @param integrationType - The type of integration, such as `'googlecalendar'`, `'slack'`, or `'github'`.
93
+ * @param integrationType - The type of integration, such as `'googlecalendar'`, `'slack'`, `'slackbot'`, `'github'`, or `'discord'`.
64
94
  * @returns Promise resolving to the access token string.
65
95
  *
66
96
  * @example
@@ -82,8 +112,8 @@ export interface ConnectorsModule {
82
112
  *
83
113
  * @example
84
114
  * ```typescript
85
- * // Slack connection
86
- * // Get Slack OAuth token and list channels
115
+ * // Slack User connection
116
+ * // Get Slack user token and list channels
87
117
  * const slackToken = await base44.asServiceRole.connectors.getAccessToken('slack');
88
118
  *
89
119
  * // List all public and private channels
@@ -95,6 +125,29 @@ export interface ConnectorsModule {
95
125
  *
96
126
  * const data = await slackResponse.json();
97
127
  * ```
128
+ *
129
+ * @example
130
+ * ```typescript
131
+ * // Slack Bot connection
132
+ * // Get Slack bot token and post a message with a custom bot identity
133
+ * const botToken = await base44.asServiceRole.connectors.getAccessToken('slackbot');
134
+ *
135
+ * const response = await fetch('https://slack.com/api/chat.postMessage', {
136
+ * method: 'POST',
137
+ * headers: {
138
+ * 'Authorization': `Bearer ${botToken}`,
139
+ * 'Content-Type': 'application/json'
140
+ * },
141
+ * body: JSON.stringify({
142
+ * channel: '#alerts',
143
+ * text: 'Deployment to production completed successfully.',
144
+ * username: 'Deploy Bot',
145
+ * icon_emoji: ':rocket:'
146
+ * })
147
+ * });
148
+ *
149
+ * const result = await response.json();
150
+ * ```
98
151
  */
99
152
  getAccessToken(integrationType: ConnectorIntegrationType): Promise<string>;
100
153
  /**
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "@base44-preview/sdk",
3
- "version": "0.8.19-pr.135.d9d067f",
3
+ "version": "0.8.20-pr.136.f19f6e0",
4
4
  "description": "JavaScript SDK for Base44 API",
5
5
  "main": "dist/index.js",
6
6
  "types": "dist/index.d.ts",