Skip to content

Commit 325700e

Browse files
committed
Add missing connector types and improve SDK docs
- Add slackbot, discord, googlebigquery, and github to connectors JSDoc with available connectors table and Slack User vs Bot explanation - Expose ConnectorIntegrationType and ConnectorIntegrationTypeRegistry in generated docs via types-to-expose and appended-articles config - Group connector types under Type Definitions in post-processing - Fix copy-to-local-docs to support dropdowns navigation format - Remove SSO from loginWithProvider docs (not ready for public docs) - Switch auth provider list separators from hyphens to colons Made-with: Cursor
1 parent ead5bf3 commit 325700e

7 files changed

Lines changed: 88 additions & 24 deletions

File tree

.claude/skills/sdk-docs-writing/SKILL.md

Lines changed: 4 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -196,6 +196,10 @@ mint dev
196196
197197
When adding a new public type, add it to `types-to-expose.json`. When a helper type should live inside another page, add it to `appended-articles.json`.
198198
199+
## Review checklist for multi-page changes
200+
201+
When a docs task touches three or more pages in `mintlify-docs` (including pages regenerated by `create-docs-local`), create a `REVIEW-CHECKLIST.md` file in the mintlify-docs repo root listing every affected page with its URL path and what to verify. Split the list into intentional changes and side-effect changes from regeneration. Add a reminder to delete the file before committing. Tell the user the checklist exists so they can work through it at their own pace.
202+
199203
## Checklist before submitting a PR
200204
201205
1. **JSDoc completeness:** Every public method has description, `@param`, `@returns`, and `@example`.

scripts/mintlify-post-processing/appended-articles.json

Lines changed: 4 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -1,4 +1,8 @@
11
{
2+
"interfaces/ConnectorsModule": [
3+
"type-aliases/ConnectorIntegrationType",
4+
"interfaces/ConnectorIntegrationTypeRegistry"
5+
],
26
"type-aliases/EntitiesModule": [
37
"interfaces/EntityHandler",
48
"type-aliases/EntityRecord",

scripts/mintlify-post-processing/copy-to-local-docs.js

Lines changed: 7 additions & 6 deletions
Original file line numberDiff line numberDiff line change
@@ -160,7 +160,8 @@ function updateDocsJson(repoDir, sdkFiles) {
160160
`SDK Reference pages: ${JSON.stringify(sdkReferencePages, null, 2)}`
161161
);
162162

163-
// Navigate to: Developers tab -> anchors -> SDK anchor -> groups -> SDK Reference
163+
// Navigate to: Developers tab -> SDK section -> groups -> SDK Reference
164+
// Supports both legacy "anchors" format and current "dropdowns" format.
164165
const developersTab = docs.navigation.tabs.find(
165166
(tab) => tab.tab === "Developers"
166167
);
@@ -170,13 +171,13 @@ function updateDocsJson(repoDir, sdkFiles) {
170171
process.exit(1);
171172
}
172173

173-
// Find the SDK anchor
174-
const sdkAnchor = developersTab.anchors?.find(
175-
(anchor) => anchor.anchor === "SDK"
176-
);
174+
// Find the SDK section (try dropdowns first, then fall back to anchors)
175+
const sdkAnchor =
176+
developersTab.dropdowns?.find((d) => d.dropdown === "SDK") ??
177+
developersTab.anchors?.find((a) => a.anchor === "SDK");
177178

178179
if (!sdkAnchor) {
179-
console.error("Could not find 'SDK' anchor in Developers tab");
180+
console.error("Could not find 'SDK' dropdown or anchor in Developers tab");
180181
process.exit(1);
181182
}
182183

scripts/mintlify-post-processing/file-processing/file-processing.js

Lines changed: 5 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -1286,6 +1286,11 @@ function groupTypeDefinitions(content) {
12861286

12871287
// Define type definition patterns for different modules
12881288
const typeGroups = [
1289+
// Connectors module
1290+
{
1291+
types: ["ConnectorIntegrationType", "ConnectorIntegrationTypeRegistry"],
1292+
indicator: "ConnectorIntegrationType"
1293+
},
12891294
// Entities module
12901295
{
12911296
types: ["EntityRecord", "EntityTypeRegistry", "SortField"],

scripts/mintlify-post-processing/types-to-expose.json

Lines changed: 2 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -5,6 +5,8 @@
55
"AnalyticsModule",
66
"AppLogsModule",
77
"AuthModule",
8+
"ConnectorIntegrationType",
9+
"ConnectorIntegrationTypeRegistry",
810
"ConnectorsModule",
911
"CustomIntegrationsModule",
1012
"DeleteManyResult",

src/modules/auth.types.ts

Lines changed: 5 additions & 11 deletions
Original file line numberDiff line numberDiff line change
@@ -195,13 +195,12 @@ export interface AuthModule {
195195
* Initiates an OAuth login flow with one of the built-in providers. Requires a browser environment and can't be used in the backend.
196196
*
197197
* Supported providers:
198-
* - `'google'` - {@link https://developers.google.com/identity/protocols/oauth2 | Google OAuth}. Enabled by default.
199-
* - `'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.
200-
* - `'facebook'` - {@link https://developers.facebook.com/docs/facebook-login | Facebook Login}. Enable Facebook in your app's authentication settings before using.
201-
* - `'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.
202-
* - `'sso'` - Enterprise SSO. Enable SSO in your app's authentication settings before using this provider.
198+
* - `'google'`: {@link https://developers.google.com/identity/protocols/oauth2 | Google OAuth}. Enabled by default.
199+
* - `'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.
200+
* - `'facebook'`: {@link https://developers.facebook.com/docs/facebook-login | Facebook Login}. Enable Facebook in your app's authentication settings before using.
201+
* - `'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.
203202
*
204-
* @param provider - The authentication provider to use: `'google'`, `'microsoft'`, `'facebook'`, `'apple'`, or `'sso'`.
203+
* @param provider - The authentication provider to use: `'google'`, `'microsoft'`, `'facebook'`, or `'apple'`.
205204
* @param fromUrl - URL to redirect to after successful authentication. Defaults to `'/'`.
206205
*
207206
* @example
@@ -222,11 +221,6 @@ export interface AuthModule {
222221
* base44.auth.loginWithProvider('apple', '/dashboard');
223222
* ```
224223
*
225-
* @example
226-
* ```typescript
227-
* // SSO
228-
* base44.auth.loginWithProvider('sso', '/dashboard');
229-
* ```
230224
*/
231225
loginWithProvider(provider: string, fromUrl?: string): void;
232226

src/modules/connectors.types.ts

Lines changed: 61 additions & 7 deletions
Original file line numberDiff line numberDiff line change
@@ -13,9 +13,10 @@ export interface ConnectorIntegrationTypeRegistry {}
1313
* const token = await base44.asServiceRole.connectors.getAccessToken('googlecalendar');
1414
* ```
1515
*/
16-
export type ConnectorIntegrationType = keyof ConnectorIntegrationTypeRegistry extends never
17-
? string
18-
: keyof ConnectorIntegrationTypeRegistry;
16+
export type ConnectorIntegrationType =
17+
keyof ConnectorIntegrationTypeRegistry extends never
18+
? string
19+
: keyof ConnectorIntegrationTypeRegistry;
1920

2021
/**
2122
* Response from the connectors access token endpoint.
@@ -27,13 +28,43 @@ export interface ConnectorAccessTokenResponse {
2728
/**
2829
* Connectors module for managing OAuth tokens for external services.
2930
*
30-
* 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.
31+
* 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.
3132
*
3233
* Unlike the integrations module that provides pre-built functions, connectors give you
3334
* raw OAuth tokens so you can call external service APIs directly with full control over
3435
* the API calls you make. This is useful when you need custom API interactions that aren't
3536
* covered by Base44's pre-built integrations.
3637
*
38+
* ## Available connectors
39+
*
40+
* 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.
41+
*
42+
* | Service | Type identifier |
43+
* |---|---|
44+
* | Discord | `discord` |
45+
* | GitHub | `github` |
46+
* | Gmail | `gmail` |
47+
* | Google BigQuery | `googlebigquery` |
48+
* | Google Calendar | `googlecalendar` |
49+
* | Google Docs | `googledocs` |
50+
* | Google Drive | `googledrive` |
51+
* | Google Sheets | `googlesheets` |
52+
* | Google Slides | `googleslides` |
53+
* | HubSpot | `hubspot` |
54+
* | LinkedIn | `linkedin` |
55+
* | Notion | `notion` |
56+
* | Salesforce | `salesforce` |
57+
* | Slack User | `slack` |
58+
* | Slack Bot | `slackbot` |
59+
* | TikTok | `tiktok` |
60+
*
61+
* ### Slack User vs Slack Bot
62+
*
63+
* Base44 provides two separate Slack connectors with different OAuth flows:
64+
*
65+
* - **`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.
66+
* - **`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.
67+
*
3768
* ## Authentication Modes
3869
*
3970
* 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.
@@ -50,7 +81,7 @@ export interface ConnectorsModule {
5081
* has connected to. This token represents the connected app builder's account
5182
* and can be used to make authenticated API calls to that external service on behalf of the app.
5283
*
53-
* @param integrationType - The type of integration, such as `'googlecalendar'`, `'slack'`, or `'github'`.
84+
* @param integrationType - The type of integration, such as `'googlecalendar'`, `'slack'`, `'slackbot'`, `'github'`, or `'discord'`.
5485
* @returns Promise resolving to the access token string.
5586
*
5687
* @example
@@ -72,8 +103,8 @@ export interface ConnectorsModule {
72103
*
73104
* @example
74105
* ```typescript
75-
* // Slack connection
76-
* // Get Slack OAuth token and list channels
106+
* // Slack User connection
107+
* // Get Slack user token and list channels
77108
* const slackToken = await base44.asServiceRole.connectors.getAccessToken('slack');
78109
*
79110
* // List all public and private channels
@@ -85,6 +116,29 @@ export interface ConnectorsModule {
85116
*
86117
* const data = await slackResponse.json();
87118
* ```
119+
*
120+
* @example
121+
* ```typescript
122+
* // Slack Bot connection
123+
* // Get Slack bot token and post a message with a custom bot identity
124+
* const botToken = await base44.asServiceRole.connectors.getAccessToken('slackbot');
125+
*
126+
* const response = await fetch('https://slack.com/api/chat.postMessage', {
127+
* method: 'POST',
128+
* headers: {
129+
* 'Authorization': `Bearer ${botToken}`,
130+
* 'Content-Type': 'application/json'
131+
* },
132+
* body: JSON.stringify({
133+
* channel: '#alerts',
134+
* text: 'Deployment to production completed successfully.',
135+
* username: 'Deploy Bot',
136+
* icon_emoji: ':rocket:'
137+
* })
138+
* });
139+
*
140+
* const result = await response.json();
141+
* ```
88142
*/
89143
getAccessToken(integrationType: ConnectorIntegrationType): Promise<string>;
90144
}

0 commit comments

Comments
 (0)